Class: AmplitudeExperiment::Evaluation::Allocation

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#distributionsObject

Returns the value of attribute distributions.



19
20
21
# File 'lib/experiment/evaluation/flag.rb', line 19

def distributions
  @distributions
end

#rangeObject

Returns the value of attribute range.



19
20
21
# File 'lib/experiment/evaluation/flag.rb', line 19

def range
  @range
end

Class Method Details

.from_hash(hash) ⇒ Object



21
22
23
24
25
26
# File 'lib/experiment/evaluation/flag.rb', line 21

def self.from_hash(hash)
  new.tap do |alloc|
    alloc.range = hash['range']
    alloc.distributions = hash['distributions']&.map { |d| Distribution.from_hash(d) }
  end
end