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.
444 445 446 |
# File 'lib/feature.rb', line 444 def initialize(params) @params = params end |
Instance Attribute Details
#params ⇒ Object (readonly)
Returns the value of attribute params.
442 443 444 |
# File 'lib/feature.rb', line 442 def params @params end |
Instance Method Details
#gate_specified? ⇒ Boolean
448 449 450 |
# File 'lib/feature.rb', line 448 def gate_specified? %i[user project group feature_group namespace repository].any? { |key| params.key?(key) } end |
#targets ⇒ Object
452 453 454 |
# File 'lib/feature.rb', line 452 def targets [feature_group, users, projects, groups, namespaces, repositories].flatten.compact end |