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.
492 493 494 |
# File 'lib/feature.rb', line 492 def initialize(params) @params = params end |
Instance Attribute Details
#params ⇒ Object (readonly)
Returns the value of attribute params.
490 491 492 |
# File 'lib/feature.rb', line 490 def params @params end |
Instance Method Details
#gate_specified? ⇒ Boolean
496 497 498 |
# File 'lib/feature.rb', line 496 def gate_specified? i[user project group feature_group namespace repository].any? { |key| params.key?(key) } end |
#targets ⇒ Object
500 501 502 |
# File 'lib/feature.rb', line 500 def targets [feature_group, users, projects, groups, namespaces, repositories].flatten.compact end |