Class: Feature::Target
- Inherits:
-
Object
- Object
- Feature::Target
- Defined in:
- lib/feature.rb
Constant Summary collapse
- UnknownTargetError =
Class.new(StandardError)
Instance Attribute Summary collapse
-
#params ⇒ Object
readonly
Returns the value of attribute params.
Instance Method Summary collapse
- #gate_specified? ⇒ Boolean
-
#initialize(params) ⇒ Target
constructor
A new instance of Target.
- #targets ⇒ Object
Constructor Details
#initialize(params) ⇒ Target
Returns a new instance of Target.
368 369 370 |
# File 'lib/feature.rb', line 368 def initialize(params) @params = params end |
Instance Attribute Details
#params ⇒ Object (readonly)
Returns the value of attribute params.
366 367 368 |
# File 'lib/feature.rb', line 366 def params @params end |
Instance Method Details
#gate_specified? ⇒ Boolean
372 373 374 |
# File 'lib/feature.rb', line 372 def gate_specified? %i[user project group feature_group namespace repository].any? { |key| params.key?(key) } end |
#targets ⇒ Object
376 377 378 |
# File 'lib/feature.rb', line 376 def targets [feature_group, users, projects, groups, namespaces, repositories].flatten.compact end |