Class: Ci::VariablesFinder
- Inherits:
-
Object
- Object
- Ci::VariablesFinder
- Defined in:
- app/finders/ci/variables_finder.rb
Instance Attribute Summary collapse
-
#params ⇒ Object
readonly
Returns the value of attribute params.
-
#project ⇒ Object
readonly
Returns the value of attribute project.
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(project, params) ⇒ VariablesFinder
constructor
A new instance of VariablesFinder.
Constructor Details
#initialize(project, params) ⇒ VariablesFinder
Returns a new instance of VariablesFinder.
7 8 9 10 11 |
# File 'app/finders/ci/variables_finder.rb', line 7 def initialize(project, params) @project, @params = project, params raise ArgumentError, 'Please provide params[:key]' if params[:key].blank? end |
Instance Attribute Details
#params ⇒ Object (readonly)
Returns the value of attribute params
5 6 7 |
# File 'app/finders/ci/variables_finder.rb', line 5 def params @params end |
#project ⇒ Object (readonly)
Returns the value of attribute project
5 6 7 |
# File 'app/finders/ci/variables_finder.rb', line 5 def project @project end |
Instance Method Details
#execute ⇒ Object
13 14 15 16 17 18 |
# File 'app/finders/ci/variables_finder.rb', line 13 def execute variables = project.variables variables = by_key(variables) variables = by_environment_scope(variables) variables end |