Module RR::Syncers
In: lib/rubyrep/syncers/syncers.rb
lib/rubyrep/syncers/two_way_syncer.rb

Syncers are classes that implement the sync policies. This module provides functionality to register syncers and access the list of registered syncers. Each Syncer must register itself with Syncers#register. Each Syncer must implement the following methods:

  # Creates a new syncer (A syncer is used for one table sync only)
  #   * sync_helper: a SyncHelper object providing necessary information and functionalities
  def initialize(sync_helper)

  # Called to sync the provided difference.
  # See DirectTableScan#run for a description of the +type+ and +row+ parameters.
  def sync_difference(type, row)

  # Provides default option for the syncer. Optional.
  # Returns a hash with :key => value pairs.
  def self.default_options

Methods

Classes and Modules

Class RR::Syncers::OneWaySyncer
Class RR::Syncers::TwoWaySyncer

Public Class methods

Returns the correct syncer class as per provided options hash

Registers one or multiple syncers. syncer_hash is a Hash with

  key::   The adapter symbol as used to reference the syncer
  value:: The class implementing the syncer

Returns a Hash of currently registered syncers. (Empty Hash if no syncers were defined.)

[Validate]