Class: LaunchDarkly::Integrations::TestData::FlagBuilder::FlagMigrationSettingsBuilder
- Inherits:
-
Object
- Object
- LaunchDarkly::Integrations::TestData::FlagBuilder::FlagMigrationSettingsBuilder
- Defined in:
- lib/ldclient-rb/integrations/test_data/flag_builder.rb
Overview
A builder for feature flag migration settings to be used with LaunchDarkly::Integrations::TestData::FlagBuilder.
In the LaunchDarkly model, a flag can be a standard feature flag, or it can be a migration-related flag, in which case it has migration-specified related settings. These settings control things like the rate at which reads are tested for consistency between origins.
Instance Method Summary collapse
- #build ⇒ Object
- #check_ratio(ratio) ⇒ FlagMigrationSettingsBuilder
-
#initialize ⇒ FlagMigrationSettingsBuilder
constructor
A new instance of FlagMigrationSettingsBuilder.
Constructor Details
#initialize ⇒ FlagMigrationSettingsBuilder
Returns a new instance of FlagMigrationSettingsBuilder.
452 453 454 |
# File 'lib/ldclient-rb/integrations/test_data/flag_builder.rb', line 452 def initialize() @check_ratio = nil end |
Instance Method Details
#build ⇒ Object
466 467 468 469 470 471 472 |
# File 'lib/ldclient-rb/integrations/test_data/flag_builder.rb', line 466 def build return nil if @check_ratio.nil? || @check_ratio == 1 { "checkRatio": @check_ratio, } end |
#check_ratio(ratio) ⇒ FlagMigrationSettingsBuilder
460 461 462 463 464 |
# File 'lib/ldclient-rb/integrations/test_data/flag_builder.rb', line 460 def check_ratio(ratio) return unless ratio.is_a? Integer @check_ratio = ratio self end |