Class: Corral::Feature

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(feature, condition, disabled) ⇒ Feature

Returns a new instance of Feature.



7
8
9
10
11
# File 'lib/corral.rb', line 7

def initialize(feature, condition, disabled)
  @feature = feature
  @condition = condition
  @disabled = disabled
end

Instance Attribute Details

#conditionObject (readonly)

Returns the value of attribute condition.



5
6
7
# File 'lib/corral.rb', line 5

def condition
  @condition
end

Class Method Details

.get(name) ⇒ Object



18
19
20
# File 'lib/corral.rb', line 18

def self.get(name)
  (@features ||= {})[name]
end

.push(name, condition, disabled = true) ⇒ Object



13
14
15
16
# File 'lib/corral.rb', line 13

def self.push(name, condition, disabled = true)
  @features ||= {}
  @features[name] = new(name, condition, disabled)
end