Sha256: bd7e2268131cab6184bb118602844fdcacef4b316e55a293501d4a157ee50627
Contents?: true
Size: 424 Bytes
Versions: 14
Compression:
Stored size: 424 Bytes
Contents
# frozen_string_literal: true module Sail module Types # 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. class Throttle < Type def to_value 100 * rand <= @setting.value.to_f end end end end
Version data entries
14 entries across 14 versions & 1 rubygems