Class: Kameleoon::Configuration::VariationByExposition
- Inherits:
-
Object
- Object
- Kameleoon::Configuration::VariationByExposition
- Defined in:
- lib/kameleoon/configuration/variation_exposition.rb
Overview
VariationByExposition represents a variation with exposition rate for rule
Instance Attribute Summary collapse
-
#exposition ⇒ Object
readonly
Returns the value of attribute exposition.
-
#variation_id ⇒ Object
readonly
Returns the value of attribute variation_id.
-
#variation_key ⇒ Object
readonly
Returns the value of attribute variation_key.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(hash) ⇒ VariationByExposition
constructor
A new instance of VariationByExposition.
- #to_s ⇒ Object
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
#exposition ⇒ Object (readonly)
Returns the value of attribute exposition.
8 9 10 |
# File 'lib/kameleoon/configuration/variation_exposition.rb', line 8 def exposition @exposition end |
#variation_id ⇒ Object (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_key ⇒ Object (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_s ⇒ Object
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 |