Class: AmplitudeExperiment::Evaluation::Bucket

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#allocationsObject

Returns the value of attribute allocations.



42
43
44
# File 'lib/experiment/evaluation/flag.rb', line 42

def allocations
  @allocations
end

#saltObject

Returns the value of attribute salt.



42
43
44
# File 'lib/experiment/evaluation/flag.rb', line 42

def salt
  @salt
end

#selectorObject

Returns the value of attribute selector.



42
43
44
# File 'lib/experiment/evaluation/flag.rb', line 42

def selector
  @selector
end

Class Method Details

.from_hash(hash) ⇒ Object



44
45
46
47
48
49
50
# File 'lib/experiment/evaluation/flag.rb', line 44

def self.from_hash(hash)
  new.tap do |bucket|
    bucket.selector = hash['selector']
    bucket.salt = hash['salt']
    bucket.allocations = hash['allocations']&.map { |a| Allocation.from_hash(a) }
  end
end