Class: AmplitudeExperiment::Evaluation::Flag

Inherits:
Object
  • Object
show all
Defined in:
lib/experiment/evaluation/flag.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#dependenciesObject

Returns the value of attribute dependencies.



84
85
86
# File 'lib/experiment/evaluation/flag.rb', line 84

def dependencies
  @dependencies
end

#keyObject

Returns the value of attribute key.



84
85
86
# File 'lib/experiment/evaluation/flag.rb', line 84

def key
  @key
end

#metadataObject

Returns the value of attribute metadata.



84
85
86
# File 'lib/experiment/evaluation/flag.rb', line 84

def 
  
end

#segmentsObject

Returns the value of attribute segments.



84
85
86
# File 'lib/experiment/evaluation/flag.rb', line 84

def segments
  @segments
end

#variantsObject

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