Class: Kameleoon::Configuration::Variation
- Inherits:
-
Object
- Object
- Kameleoon::Configuration::Variation
- Defined in:
- lib/kameleoon/configuration/variation.rb
Overview
Variation of feature flag
Instance Attribute Summary collapse
-
#key ⇒ Object
Returns the value of attribute key.
-
#variables ⇒ Object
Returns the value of attribute variables.
Class Method Summary collapse
Instance Method Summary collapse
- #get_variable_by_key(key) ⇒ Object
-
#initialize(hash) ⇒ Variation
constructor
A new instance of Variation.
Constructor Details
#initialize(hash) ⇒ Variation
Returns a new instance of Variation.
21 22 23 24 |
# File 'lib/kameleoon/configuration/variation.rb', line 21 def initialize(hash) @key = hash['key'] @variables = Variable.create_from_array(hash['variables']) end |
Instance Attribute Details
#key ⇒ Object
Returns the value of attribute key.
15 16 17 |
# File 'lib/kameleoon/configuration/variation.rb', line 15 def key @key end |
#variables ⇒ Object
Returns the value of attribute variables.
15 16 17 |
# File 'lib/kameleoon/configuration/variation.rb', line 15 def variables @variables end |
Class Method Details
Instance Method Details
#get_variable_by_key(key) ⇒ Object
26 27 28 |
# File 'lib/kameleoon/configuration/variation.rb', line 26 def get_variable_by_key(key) variables.select { |var| var.key == key }.first end |