Class: Kameleoon::Configuration::VariationByExposition

Inherits:
Object
  • Object
show all
Defined in:
lib/kameleoon/configuration/variation_exposition.rb

Overview

VariationByExposition represents a variation with exposition rate for rule

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(hash) ⇒ VariationByExposition

Returns a new instance of VariationByExposition.



18
19
20
21
22
# File 'lib/kameleoon/configuration/variation_exposition.rb', line 18

def initialize(hash)
  @variation_key = hash['variationKey']
  @variation_id = hash['variationId']
  @exposition = hash['exposition']
end

Instance Attribute Details

#expositionObject (readonly)

Returns the value of attribute exposition.



8
9
10
# File 'lib/kameleoon/configuration/variation_exposition.rb', line 8

def exposition
  @exposition
end

#variation_idObject (readonly)

Returns the value of attribute variation_id.



8
9
10
# File 'lib/kameleoon/configuration/variation_exposition.rb', line 8

def variation_id
  @variation_id
end

#variation_keyObject (readonly)

Returns the value of attribute variation_key.



8
9
10
# File 'lib/kameleoon/configuration/variation_exposition.rb', line 8

def variation_key
  @variation_key
end

Class Method Details

.create_from_array(array) ⇒ Object



10
11
12
# File 'lib/kameleoon/configuration/variation_exposition.rb', line 10

def self.create_from_array(array)
  array&.map { |it| VariationByExposition.new(it) }
end

Instance Method Details

#to_sObject



14
15
16
# File 'lib/kameleoon/configuration/variation_exposition.rb', line 14

def to_s
  "VariationByExposition{exposition:#{@exposition},variation_key:#{@variation_key},variation_id:#{@variation_id}}"
end