Class: AmplitudeExperiment::Evaluation::Variant
- Inherits:
-
Object
- Object
- AmplitudeExperiment::Evaluation::Variant
- Defined in:
- lib/experiment/evaluation/flag.rb
Instance Attribute Summary collapse
-
#key ⇒ Object
Returns the value of attribute key.
-
#metadata ⇒ Object
Returns the value of attribute metadata.
-
#payload ⇒ Object
Returns the value of attribute payload.
-
#value ⇒ Object
Returns the value of attribute value.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#key ⇒ Object
Returns the value of attribute key.
67 68 69 |
# File 'lib/experiment/evaluation/flag.rb', line 67 def key @key end |
#metadata ⇒ Object
Returns the value of attribute metadata.
67 68 69 |
# File 'lib/experiment/evaluation/flag.rb', line 67 def @metadata end |
#payload ⇒ Object
Returns the value of attribute payload.
67 68 69 |
# File 'lib/experiment/evaluation/flag.rb', line 67 def payload @payload end |
#value ⇒ Object
Returns the value of attribute value.
67 68 69 |
# File 'lib/experiment/evaluation/flag.rb', line 67 def value @value end |
Class Method Details
.from_hash(hash) ⇒ Object
73 74 75 76 77 78 79 80 |
# File 'lib/experiment/evaluation/flag.rb', line 73 def self.from_hash(hash) new.tap do |variant| variant.key = hash['key'] variant.value = hash['value'] variant.payload = hash['payload'] variant. = hash['metadata'] end end |
Instance Method Details
#[](key) ⇒ Object
69 70 71 |
# File 'lib/experiment/evaluation/flag.rb', line 69 def [](key) instance_variable_get("@#{key}") end |