Class: Flipper::Types::Group

Inherits:
Flipper::Type show all
Defined in:
lib/flipper/types/group.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, &block) ⇒ Group

Returns a new instance of Group.



6
7
8
9
# File 'lib/flipper/types/group.rb', line 6

def initialize(name, &block)
  @name = name.to_sym
  @block = block
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



4
5
6
# File 'lib/flipper/types/group.rb', line 4

def name
  @name
end

Instance Method Details

#match?(*args) ⇒ Boolean

Returns:



11
12
13
# File 'lib/flipper/types/group.rb', line 11

def match?(*args)
  @block.call(*args) == true
end

#valueObject



15
16
17
# File 'lib/flipper/types/group.rb', line 15

def value
  @name
end