Class: AmplitudeExperiment::Evaluation::Segment
- Inherits:
-
Object
- Object
- AmplitudeExperiment::Evaluation::Segment
- Defined in:
- lib/experiment/evaluation/flag.rb
Instance Attribute Summary collapse
-
#bucket ⇒ Object
Returns the value of attribute bucket.
-
#conditions ⇒ Object
Returns the value of attribute conditions.
-
#metadata ⇒ Object
Returns the value of attribute metadata.
-
#variant ⇒ Object
Returns the value of attribute variant.
Class Method Summary collapse
Instance Attribute Details
#bucket ⇒ Object
Returns the value of attribute bucket.
54 55 56 |
# File 'lib/experiment/evaluation/flag.rb', line 54 def bucket @bucket end |
#conditions ⇒ Object
Returns the value of attribute conditions.
54 55 56 |
# File 'lib/experiment/evaluation/flag.rb', line 54 def conditions @conditions end |
#metadata ⇒ Object
Returns the value of attribute metadata.
54 55 56 |
# File 'lib/experiment/evaluation/flag.rb', line 54 def @metadata end |
#variant ⇒ Object
Returns the value of attribute variant.
54 55 56 |
# File 'lib/experiment/evaluation/flag.rb', line 54 def variant @variant end |
Class Method Details
.from_hash(hash) ⇒ Object
56 57 58 59 60 61 62 63 |
# File 'lib/experiment/evaluation/flag.rb', line 56 def self.from_hash(hash) new.tap do |segment| segment.bucket = hash['bucket'] && Bucket.from_hash(hash['bucket']) segment.conditions = hash['conditions']&.map { |c| c.map { |inner| Condition.from_hash(inner) } } segment.variant = hash['variant'] segment. = hash['metadata'] end end |