Class: ABSwitcher::Switcher
- Inherits:
-
Object
- Object
- ABSwitcher::Switcher
- Defined in:
- lib/ab_switcher/switcher.rb
Constant Summary collapse
- HEX_MAX =
15.0
Instance Attribute Summary collapse
-
#major_probability ⇒ Object
readonly
Returns the value of attribute major_probability.
-
#major_value ⇒ Object
readonly
Returns the value of attribute major_value.
-
#minor_value ⇒ Object
readonly
Returns the value of attribute minor_value.
Instance Method Summary collapse
- #hex_switch(hex_str) ⇒ Object
-
#initialize(ratio, another_ratio = nil, major: true, minor: false) ⇒ Switcher
constructor
A new instance of Switcher.
Constructor Details
#initialize(ratio, another_ratio = nil, major: true, minor: false) ⇒ Switcher
Returns a new instance of Switcher.
7 8 9 10 |
# File 'lib/ab_switcher/switcher.rb', line 7 def initialize(ratio, another_ratio = nil, major: true, minor: false) @major_probability = calc_major_probability(ratio, another_ratio) @major_value, @minor_value = major, minor end |
Instance Attribute Details
#major_probability ⇒ Object (readonly)
Returns the value of attribute major_probability.
5 6 7 |
# File 'lib/ab_switcher/switcher.rb', line 5 def major_probability @major_probability end |
#major_value ⇒ Object (readonly)
Returns the value of attribute major_value.
5 6 7 |
# File 'lib/ab_switcher/switcher.rb', line 5 def major_value @major_value end |
#minor_value ⇒ Object (readonly)
Returns the value of attribute minor_value.
5 6 7 |
# File 'lib/ab_switcher/switcher.rb', line 5 def minor_value @minor_value end |