Class: Feature::Target

Inherits:
Object
  • Object
show all
Defined in:
lib/feature.rb

Constant Summary collapse

UnknownTargetError =
Class.new(StandardError)

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#paramsObject (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

Returns:

  • (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

#targetsObject



452
453
454
# File 'lib/feature.rb', line 452

def targets
  [feature_group, users, projects, groups, namespaces, repositories].flatten.compact
end