Class: LaunchDarkly::Impl::Migrations::MigrationConfig
- Inherits:
-
Object
- Object
- LaunchDarkly::Impl::Migrations::MigrationConfig
- 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.
Instance Attribute Summary collapse
-
#comparison ⇒ #call?
readonly
Optional callable which receives two objects of any kind and returns a boolean representing equality.
-
#new ⇒ #call
readonly
Callable which receives a nullable payload parameter and returns an Result.
-
#old ⇒ #call
readonly
Callable which receives a nullable payload parameter and returns an Result.
Instance Method Summary collapse
-
#initialize(old, new, comparison) ⇒ MigrationConfig
constructor
A new instance of MigrationConfig.
Constructor Details
#initialize(old, new, comparison) ⇒ MigrationConfig
Returns a new instance of MigrationConfig.
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.
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.
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.
31 32 33 |
# File 'lib/ldclient-rb/impl/migrations/migrator.rb', line 31 def old @old end |