Class: Flipper::Adapters::Sync::Synchronizer
- Inherits:
-
Object
- Object
- Flipper::Adapters::Sync::Synchronizer
- Defined in:
- lib/flipper/adapters/sync/synchronizer.rb
Overview
Public: Given a local and remote adapter, it can update the local to match the remote doing only the necessary enable/disable operations.
Instance Method Summary collapse
-
#call ⇒ Object
Public: Forces a sync.
-
#initialize(local, remote, options = {}) ⇒ Synchronizer
constructor
Public: Initializes a new synchronizer.
Constructor Details
#initialize(local, remote, options = {}) ⇒ Synchronizer
Public: Initializes a new synchronizer.
local - The Flipper adapter to get in sync with the remote. remote - The Flipper adapter that is source of truth that the local
adapter should be brought in line with.
options - The Hash of options.
:instrumenter - The instrumenter used to instrument.
:raise - Should errors be raised (default: true).
19 20 21 22 23 24 |
# File 'lib/flipper/adapters/sync/synchronizer.rb', line 19 def initialize(local, remote, = {}) @local = local @remote = remote @instrumenter = .fetch(:instrumenter, Instrumenters::Noop) @raise = .fetch(:raise, true) end |
Instance Method Details
#call ⇒ Object
Public: Forces a sync.
27 28 29 |
# File 'lib/flipper/adapters/sync/synchronizer.rb', line 27 def call @instrumenter.instrument("synchronizer_call.flipper") { sync } end |