Class/Module Index [+]

Quicksearch

RR::Replicators

Replicators are classes that implement the replication policies. This module provides functionality to register replicators and access the list of registered replicators. Each Replicator must register itself with Replicators#register. Each Replicator must implement the following methods:

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

# Called to sync the provided difference.
# +difference+ is an instance of +ReplicationDifference+
def replicate_difference(difference)

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

Public Class Methods

configured_replicator(options) click to toggle source

Returns the correct replicator class as per provided options hash

# File lib/rubyrep/replicators/replicators.rb, line 28
def self.configured_replicator(options)
  replicators[options[:replicator]]
end
register(replicator_hash) click to toggle source

Registers one or multiple replicators. syncer_hash is a Hash with

key::   The adapter symbol as used to reference the replicator
value:: The class implementing the replicator
# File lib/rubyrep/replicators/replicators.rb, line 36
def self.register(replicator_hash)
  @replicators ||= {}
  @replicators.merge! replicator_hash
end
replicators() click to toggle source

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

# File lib/rubyrep/replicators/replicators.rb, line 22
def self.replicators
  @replicators ||= {}
  @replicators
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.