class Sail::Types::Throttle

Throttle

The Throttle type returns true X% of the time (randomly), where X is the value saved in the database.

Example:

If the setting value is 30, it will return true 30% of the time.

Public Instance Methods

to_value() click to toggle source
# File lib/sail/types/throttle.rb, line 16
def to_value
  100 * rand <= @setting.value.to_f
end