Class: LaunchDarkly::Impl::Migrations::MigrationConfig

Inherits:
Object
  • Object
show all
Defined in:
lib/ldclient-rb/impl/migrations/migrator.rb

Overview

A migration config stores references to callable methods which execute customer defined read or write operations on old or new origins of information. For read operations, an optional comparison function also be defined.

Since:

  • 5.5.0

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(old, new, comparison) ⇒ MigrationConfig

Returns a new instance of MigrationConfig.

Parameters:

  • old (#call)

    Refer to #old

  • new (#call)

    Refer to #new

  • comparison (#call, nil)

    Refer to #comparison

Since:

  • 5.5.0



18
19
20
21
22
# File 'lib/ldclient-rb/impl/migrations/migrator.rb', line 18

def initialize(old, new, comparison)
  @old = old
  @new = new
  @comparison = comparison
end

Instance Attribute Details

#comparison#call? (readonly)

Optional callable which receives two objects of any kind and returns a boolean representing equality.

The result of this comparison can be sent upstream to LaunchDarkly to enhance migration observability.

Returns:

  • (#call, nil)

Since:

  • 5.5.0



49
50
51
# File 'lib/ldclient-rb/impl/migrations/migrator.rb', line 49

def comparison
  @comparison
end

#new#call (readonly)

Callable which receives a nullable payload parameter and returns an Result.

This function call should affect the new migration origin when called.

Returns:

  • (#call)

Since:

  • 5.5.0



40
41
42
# File 'lib/ldclient-rb/impl/migrations/migrator.rb', line 40

def new
  @new
end

#old#call (readonly)

Callable which receives a nullable payload parameter and returns an Result.

This function call should affect the old migration origin when called.

Returns:

  • (#call)

Since:

  • 5.5.0



31
32
33
# File 'lib/ldclient-rb/impl/migrations/migrator.rb', line 31

def old
  @old
end