Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app/finders/ci/variables_finder.rb')
-rw-r--r--app/finders/ci/variables_finder.rb14
1 files changed, 7 insertions, 7 deletions
diff --git a/app/finders/ci/variables_finder.rb b/app/finders/ci/variables_finder.rb
index d933643ffb2..39a1a60596d 100644
--- a/app/finders/ci/variables_finder.rb
+++ b/app/finders/ci/variables_finder.rb
@@ -2,23 +2,23 @@
module Ci
class VariablesFinder
- attr_reader :project, :params
-
- def initialize(project, params)
- @project, @params = project, params
+ def initialize(resource, params)
+ @resource = resource
+ @params = params
raise ArgumentError, 'Please provide params[:key]' if params[:key].blank?
end
def execute
- variables = project.variables
+ variables = resource.variables
variables = by_key(variables)
- variables = by_environment_scope(variables)
- variables
+ by_environment_scope(variables)
end
private
+ attr_reader :resource, :params
+
def by_key(variables)
variables.by_key(params[:key])
end