Module: TableSync

Defined in:
lib/table_sync.rb,
lib/table_sync/utils.rb,
lib/table_sync/errors.rb,
lib/table_sync/version.rb,
lib/table_sync/receiving.rb,
lib/table_sync/publishing.rb

Defined Under Namespace

Modules: Instrument, InstrumentAdapter, NamingResolver, ORMAdapter, Publishing, Receiving, Setup, Utils Classes: DataError, DestroyError, Event, EventError, InterfaceError, NoCallableError, NoPrimaryKeyError, UpsertError, WrongOptionValue

Constant Summary collapse

Error =
Class.new(StandardError)
NoObjectsForSyncError =
Class.new(Error)
InvalidConfig =
Class.new(Error)
UndefinedEvent =
Class.new(Error)
ORMNotSupported =
Class.new(Error)
VERSION =
"6.6.1"

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.batch_publishing_job_class_callableObject

Returns the value of attribute batch_publishing_job_class_callable.



36
37
38
# File 'lib/table_sync.rb', line 36

def batch_publishing_job_class_callable
  @batch_publishing_job_class_callable
end

.exchange_nameObject

Returns the value of attribute exchange_name.



38
39
40
# File 'lib/table_sync.rb', line 38

def exchange_name
  @exchange_name
end

.headers_callableObject

Returns the value of attribute headers_callable.



39
40
41
# File 'lib/table_sync.rb', line 39

def headers_callable
  @headers_callable
end

.notifierObject

Returns the value of attribute notifier.



46
47
48
# File 'lib/table_sync.rb', line 46

def notifier
  @notifier
end

.notifyObject

Returns the value of attribute notify.



40
41
42
# File 'lib/table_sync.rb', line 40

def notify
  @notify
end

.ormObject

Returns the value of attribute orm.



42
43
44
# File 'lib/table_sync.rb', line 42

def orm
  @orm
end

.publishing_adapterObject (readonly)

Returns the value of attribute publishing_adapter.



43
44
45
# File 'lib/table_sync.rb', line 43

def publishing_adapter
  @publishing_adapter
end

.raise_on_empty_messageObject

Returns the value of attribute raise_on_empty_message.



34
35
36
# File 'lib/table_sync.rb', line 34

def raise_on_empty_message
  @raise_on_empty_message
end

.receiving_modelObject (readonly)

Returns the value of attribute receiving_model.



44
45
46
# File 'lib/table_sync.rb', line 44

def receiving_model
  @receiving_model
end

.routing_key_callableObject

Returns the value of attribute routing_key_callable.



37
38
39
# File 'lib/table_sync.rb', line 37

def routing_key_callable
  @routing_key_callable
end

.setupObject (readonly)

Returns the value of attribute setup.



45
46
47
# File 'lib/table_sync.rb', line 45

def setup
  @setup
end

.single_publishing_job_class_callableObject

Returns the value of attribute single_publishing_job_class_callable.



35
36
37
# File 'lib/table_sync.rb', line 35

def single_publishing_job_class_callable
  @single_publishing_job_class_callable
end

Class Method Details

.notify?Boolean

Returns:

  • (Boolean)


81
82
83
# File 'lib/table_sync.rb', line 81

def notify?
  !!notify
end

.sync(object_class, **options) ⇒ Object



48
49
50
51
52
53
54
55
56
# File 'lib/table_sync.rb', line 48

def sync(object_class, **options)
  setup.new(
    object_class:,
    on: options[:on],
    if_condition: options[:if],
    unless_condition: options[:unless],
    debounce_time: options[:debounce_time],
  ).register_callbacks
end