Class: RolloutPercentage

Inherits:
Object
  • Object
show all
Defined in:
lib/rollout_percentage.rb

Constant Summary collapse

VERSION =
'0.1.2'.freeze

Instance Method Summary collapse

Constructor Details

#initialize(feature_flag:, rollout_client:) ⇒ RolloutPercentage



4
5
6
7
# File 'lib/rollout_percentage.rb', line 4

def initialize(feature_flag:, rollout_client:)
  self.feature_flag = feature_flag
  self.rollout_client = rollout_client
end

Instance Method Details

#performObject



9
10
11
12
13
14
15
# File 'lib/rollout_percentage.rb', line 9

def perform
  if enabled?
    block_given? ? yield : true
  else
    false
  end
end