Class: Fino::AbTesting::Variant
- Inherits:
-
Object
- Object
- Fino::AbTesting::Variant
- Includes:
- PrettyInspectable
- Defined in:
- lib/fino/ab_testing/variant.rb
Constant Summary collapse
- CONTROL_VALUE =
Class.new do def inspect "Fino::AbTesting::Variant::CONTROL_VALUE" end def to_s "control" end end.new
Instance Attribute Summary collapse
-
#percentage ⇒ Object
readonly
Returns the value of attribute percentage.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
- #id ⇒ Object
-
#initialize(percentage:, value:) ⇒ Variant
constructor
A new instance of Variant.
Methods included from PrettyInspectable
Constructor Details
#initialize(percentage:, value:) ⇒ Variant
Returns a new instance of Variant.
18 19 20 21 |
# File 'lib/fino/ab_testing/variant.rb', line 18 def initialize(percentage:, value:) @percentage = percentage.to_f @value = value end |
Instance Attribute Details
#percentage ⇒ Object (readonly)
Returns the value of attribute percentage.
16 17 18 |
# File 'lib/fino/ab_testing/variant.rb', line 16 def percentage @percentage end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
16 17 18 |
# File 'lib/fino/ab_testing/variant.rb', line 16 def value @value end |
Instance Method Details
#id ⇒ Object
23 24 25 |
# File 'lib/fino/ab_testing/variant.rb', line 23 def id "#{percentage}-#{value}" end |