Class: Groups::EnvironmentScopesFinder
- Inherits:
-
Object
- Object
- Groups::EnvironmentScopesFinder
- Defined in:
- app/finders/groups/environment_scopes_finder.rb
Defined Under Namespace
Classes: EnvironmentScope
Constant Summary collapse
- DEFAULT_ENVIRONMENT_SCOPES_LIMIT =
100
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(group:, params: {}) ⇒ EnvironmentScopesFinder
constructor
A new instance of EnvironmentScopesFinder.
Constructor Details
#initialize(group:, params: {}) ⇒ EnvironmentScopesFinder
Returns a new instance of EnvironmentScopesFinder.
14 15 16 17 |
# File 'app/finders/groups/environment_scopes_finder.rb', line 14 def initialize(group:, params: {}) @group = group @params = params end |
Instance Method Details
#execute ⇒ Object
21 22 23 24 25 26 27 28 |
# File 'app/finders/groups/environment_scopes_finder.rb', line 21 def execute variables = group.variables variables = by_name(variables) variables = by_search(variables) variables = variables.limit(DEFAULT_ENVIRONMENT_SCOPES_LIMIT) environment_scope_names = variables.environment_scope_names environment_scope_names.map { |environment_scope| EnvironmentScope.new(environment_scope) } end |