Use attr_reader instead of instance variables
This commit is contained in:
parent
6f72039007
commit
899a80955c
1 changed files with 4 additions and 4 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue