Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
899a8095
Commit
899a8095
authored
Nov 28, 2017
by
Matija Čupić
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use attr_reader instead of instance variables
parent
6f720390
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
app/finders/clusters_finder.rb
app/finders/clusters_finder.rb
+4
-4
No files found.
app/finders/clusters_finder.rb
View file @
899a8095
class
ClustersFinder
class
ClustersFinder
attr_reader
:project
,
:user
,
:scope
def
initialize
(
project
,
user
,
scope
)
def
initialize
(
project
,
user
,
scope
)
@project
=
project
@project
=
project
@user
=
user
@user
=
user
...
@@ -14,8 +12,10 @@ class ClustersFinder
...
@@ -14,8 +12,10 @@ class ClustersFinder
private
private
attr_reader
:project
,
:user
,
:scope
def
filter_by_scope
(
clusters
)
def
filter_by_scope
(
clusters
)
case
@
scope
.
to_sym
case
scope
.
to_sym
when
:all
when
:all
clusters
clusters
when
:inactive
when
:inactive
...
@@ -23,7 +23,7 @@ class ClustersFinder
...
@@ -23,7 +23,7 @@ class ClustersFinder
when
:active
when
:active
clusters
.
enabled
clusters
.
enabled
else
else
raise
"Invalid scope
#{
@
scope
}
"
raise
"Invalid scope
#{
scope
}
"
end
end
end
end
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment