Sha256: 5b8b68cc6babc2f61d79b80f71bb521a34aac764e8ffab1a0b43c32cc7ef3830
Contents?: true
Size: 537 Bytes
Versions: 28
Compression:
Stored size: 537 Bytes
Contents
require 'unleash/strategy/util' module Unleash module Strategy class GradualRolloutRandom < Base def name 'gradualRolloutRandom' end # need: params['percentage'] def is_enabled?(params = {}, _context = nil) return false unless params.is_a?(Hash) && params.has_key?('percentage') begin percentage = Integer(params['percentage'] || 0) rescue ArgumentError return false end (percentage >= Random.rand(1..100)) end end end end
Version data entries
28 entries across 28 versions & 1 rubygems