summaryrefslogtreecommitdiff
path: root/app/finders/clusters_finder.rb
diff options
context:
space:
mode:
authorMatija Čupić <matteeyah@gmail.com>2017-11-28 14:36:12 +0100
committerMatija Čupić <matteeyah@gmail.com>2017-11-28 14:39:18 +0100
commit899a80955ca694a119f52d8f717c1f86066e6880 (patch)
tree86de74417aca6d390eca2b5757d72c70b863fede /app/finders/clusters_finder.rb
parent6f720390073beef93c95af5e45475421beb03b07 (diff)
downloadgitlab-ce-899a80955ca694a119f52d8f717c1f86066e6880.tar.gz
Use attr_reader instead of instance variables
Diffstat (limited to 'app/finders/clusters_finder.rb')
-rw-r--r--app/finders/clusters_finder.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/app/finders/clusters_finder.rb b/app/finders/clusters_finder.rb
index 26bae3193da..c13f98257bf 100644
--- a/app/finders/clusters_finder.rb
+++ b/app/finders/clusters_finder.rb
@@ -1,6 +1,4 @@
class ClustersFinder
- attr_reader :project, :user, :scope
-
def initialize(project, user, scope)
@project = project
@user = user
@@ -14,8 +12,10 @@ class ClustersFinder
private
+ attr_reader :project, :user, :scope
+
def filter_by_scope(clusters)
- case @scope.to_sym
+ case scope.to_sym
when :all
clusters
when :inactive
@@ -23,7 +23,7 @@ class ClustersFinder
when :active
clusters.enabled
else
- raise "Invalid scope #{@scope}"
+ raise "Invalid scope #{scope}"
end
end
end