Exception: SplitIoClient::Treatments
- Inherits:
-
NoMethodError
- Object
- NoMethodError
- SplitIoClient::Treatments
- Defined in:
- lib/engine/partitions/treatments.rb
Overview
represents the possible return values for a treatment
Constant Summary collapse
- CONTROL =
Constants to represent treatment values
'control'- OFF =
'off'- ON =
'on'
Class Method Summary collapse
-
.get_type(type) ⇒ Treatment
get the actual value for the given treatment type.
-
.is_control?(treatment) ⇒ boolean
checks if the give treatment matches control type.
Class Method Details
.get_type(type) ⇒ Treatment
get the actual value for the given treatment type
18 19 20 21 22 23 24 25 26 27 |
# File 'lib/engine/partitions/treatments.rb', line 18 def self.get_type(type) case type when 'on' return ON when 'off', 'control' return CONTROL else # default return off return CONTROL end end |
.is_control?(treatment) ⇒ boolean
checks if the give treatment matches control type
34 35 36 |
# File 'lib/engine/partitions/treatments.rb', line 34 def self.is_control?(treatment) get_type(treatment).equal?(CONTROL) ? true : false end |