Class: LaunchDarkly::Integrations::TestData::FlagBuilder::FlagMigrationSettingsBuilder

Inherits:
Object
  • Object
show all
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.

Since:

  • 6.3.0

Instance Method Summary collapse

Constructor Details

#initializeFlagMigrationSettingsBuilder

Returns a new instance of FlagMigrationSettingsBuilder.

Since:

  • 6.3.0



452
453
454
# File 'lib/ldclient-rb/integrations/test_data/flag_builder.rb', line 452

def initialize()
  @check_ratio = nil
end

Instance Method Details

#buildObject

Since:

  • 6.3.0



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

Parameters:

  • ratio (Integer)

Returns:

Since:

  • 6.3.0



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