Sha256: 0eacf87e2add6a6642507628474a8b825d759341a628d5b9ebd5d6d28077df7a
Contents?: true
Size: 876 Bytes
Versions: 32
Compression:
Stored size: 876 Bytes
Contents
module SplitIoClient # # represents the possible return values for a treatment # class Treatments < NoMethodError # Constants to represent treatment values CONTROL = 'control' OFF = 'off' ON = 'on' # get the actual value for the given treatment type # # @param type [string] treatment type # # @return [Treatment] treatment type value def self.get_type(type) case type when 'on' return ON when 'off', 'control' return CONTROL else # default return off return CONTROL end end # checks if the give treatment matches control type # # @param type [string] treatment type # # @return [boolean] true if matches, false otherwise def self.is_control?(treatment) get_type(treatment).equal?(CONTROL) ? true : false end end end
Version data entries
32 entries across 32 versions & 1 rubygems