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.
469 470 471 |
# File 'lib/feature.rb', line 469 def initialize(params) @params = params end |
Instance Attribute Details
#params ⇒ Object (readonly)
Returns the value of attribute params.
467 468 469 |
# File 'lib/feature.rb', line 467 def params @params end |
Instance Method Details
#gate_specified? ⇒ Boolean
473 474 475 |
# File 'lib/feature.rb', line 473 def gate_specified? i[user project group feature_group namespace repository runner].any? { |key| params.key?(key) } end |
#targets ⇒ Object
477 478 479 |
# File 'lib/feature.rb', line 477 def targets [feature_group, users, projects, groups, namespaces, repositories, runners].flatten.compact end |