Class: AmplitudeExperiment::Evaluation::Flag
- Inherits:
-
Object
- Object
- AmplitudeExperiment::Evaluation::Flag
- Defined in:
- lib/experiment/evaluation/flag.rb
Instance Attribute Summary collapse
-
#dependencies ⇒ Object
Returns the value of attribute dependencies.
-
#key ⇒ Object
Returns the value of attribute key.
-
#metadata ⇒ Object
Returns the value of attribute metadata.
-
#segments ⇒ Object
Returns the value of attribute segments.
-
#variants ⇒ Object
Returns the value of attribute variants.
Class Method Summary collapse
Instance Method Summary collapse
-
#==(other) ⇒ Object
Used for testing.
Instance Attribute Details
#dependencies ⇒ Object
Returns the value of attribute dependencies.
84 85 86 |
# File 'lib/experiment/evaluation/flag.rb', line 84 def dependencies @dependencies end |
#key ⇒ Object
Returns the value of attribute key.
84 85 86 |
# File 'lib/experiment/evaluation/flag.rb', line 84 def key @key end |
#metadata ⇒ Object
Returns the value of attribute metadata.
84 85 86 |
# File 'lib/experiment/evaluation/flag.rb', line 84 def end |
#segments ⇒ Object
Returns the value of attribute segments.
84 85 86 |
# File 'lib/experiment/evaluation/flag.rb', line 84 def segments @segments end |
#variants ⇒ Object
Returns the value of attribute variants.
84 85 86 |
# File 'lib/experiment/evaluation/flag.rb', line 84 def variants @variants end |
Class Method Details
.from_hash(hash) ⇒ Object
86 87 88 89 90 91 92 93 94 |
# File 'lib/experiment/evaluation/flag.rb', line 86 def self.from_hash(hash) new.tap do |flag| flag.key = hash['key'] flag.variants = hash['variants'].transform_values { |v| Variant.from_hash(v) } flag.segments = hash['segments'].map { |s| Segment.from_hash(s) } flag.dependencies = hash['dependencies'] flag. = hash['metadata'] end end |
Instance Method Details
#==(other) ⇒ Object
Used for testing
97 98 99 |
# File 'lib/experiment/evaluation/flag.rb', line 97 def ==(other) key == other.key end |