From 899a80955ca694a119f52d8f717c1f86066e6880 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matija=20=C4=8Cupi=C4=87?= Date: Tue, 28 Nov 2017 14:36:12 +0100 Subject: [PATCH] Use attr_reader instead of instance variables --- app/finders/clusters_finder.rb | 8 ++++---- 1 file 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