Class: Sail::Types::AbTest

Inherits:
Boolean show all
Defined in:
lib/sail/types/ab_test.rb

Overview

AbTest

The AbTest setting type returns true or false randomly (50% chance).

Instance Method Summary collapse

Methods inherited from Boolean

#from

Methods inherited from Type

#from, #initialize

Constructor Details

This class inherits a constructor from Sail::Types::Type

Instance Method Details

#to_valueObject



10
11
12
13
14
15
16
# File 'lib/sail/types/ab_test.rb', line 10

def to_value
  if @setting.value == Sail::ConstantCollection::TRUE
    Sail::ConstantCollection::BOOLEANS.sample
  else
    false
  end
end