Class: TableSync::Publishing::Message::Raw
- Inherits:
-
Object
- Object
- TableSync::Publishing::Message::Raw
- Includes:
- Tainbox
- Defined in:
- lib/table_sync/publishing/message/raw.rb
Instance Method Summary collapse
- #data ⇒ Object
-
#message_params ⇒ Object
MESSAGE PARAMS.
- #model_naming ⇒ Object
-
#notify! ⇒ Object
NOTIFY.
- #params ⇒ Object
- #publish ⇒ Object
Instance Method Details
#data ⇒ Object
42 43 44 45 46 |
# File 'lib/table_sync/publishing/message/raw.rb', line 42 def data TableSync::Publishing::Data::Raw.new( object_class: object_class, attributes_for_sync: original_attributes, event: event, ).construct end |
#message_params ⇒ Object
MESSAGE PARAMS
38 39 40 |
# File 'lib/table_sync/publishing/message/raw.rb', line 38 def params.merge(data: data) end |
#model_naming ⇒ Object
32 33 34 |
# File 'lib/table_sync/publishing/message/raw.rb', line 32 def model_naming TableSync.publishing_adapter.model_naming(object_class.constantize) end |
#notify! ⇒ Object
NOTIFY
22 23 24 25 26 27 28 29 30 |
# File 'lib/table_sync/publishing/message/raw.rb', line 22 def notify! TableSync::Instrument.notify( table: model_naming.table, schema: model_naming.schema, event: event, count: original_attributes.count, direction: :publish, ) end |
#params ⇒ Object
48 49 50 51 52 |
# File 'lib/table_sync/publishing/message/raw.rb', line 48 def params TableSync::Publishing::Params::Raw.new( object_class: object_class, routing_key: routing_key, headers: headers, ).construct end |
#publish ⇒ Object
14 15 16 17 18 |
# File 'lib/table_sync/publishing/message/raw.rb', line 14 def publish Rabbit.publish() notify! end |