Class: Flip::DeclarationStrategy
Instance Method Summary
collapse
#delete!, #name, #switch!, #switchable?
Instance Method Details
#description ⇒ Object
6
7
8
|
# File 'lib/flip/declaration_strategy.rb', line 6
def description
"The default status declared with the feature."
end
|
#knows?(definition) ⇒ Boolean
10
11
12
|
# File 'lib/flip/declaration_strategy.rb', line 10
def knows? definition
!definition.options[:default].nil?
end
|
#on?(definition) ⇒ Boolean
14
15
16
17
|
# File 'lib/flip/declaration_strategy.rb', line 14
def on? definition
default = definition.options[:default]
default.is_a?(Proc) ? default.call(definition) : default
end
|