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.
-
#notify! ⇒ Object
NOTIFY.
- #params ⇒ Object
- #publish ⇒ Object
Instance Method Details
#data ⇒ Object
41 42 43 44 45 |
# File 'lib/table_sync/publishing/message/raw.rb', line 41 def data TableSync::Publishing::Data::Raw.new( model_name: model_name, attributes_for_sync: original_attributes, event: event, ).construct end |
#message_params ⇒ Object
MESSAGE PARAMS
37 38 39 |
# File 'lib/table_sync/publishing/message/raw.rb', line 37 def params.merge(data: data) end |
#notify! ⇒ Object
NOTIFY
25 26 27 28 29 30 31 32 33 |
# File 'lib/table_sync/publishing/message/raw.rb', line 25 def notify! TableSync::Instrument.notify( table: table_name, schema: schema_name, event: event, count: original_attributes.count, direction: :publish, ) end |
#params ⇒ Object
47 48 49 50 51 |
# File 'lib/table_sync/publishing/message/raw.rb', line 47 def params TableSync::Publishing::Params::Raw.new( attributes.slice(:model_name, :headers, :routing_key).compact, ).construct end |
#publish ⇒ Object
17 18 19 20 21 |
# File 'lib/table_sync/publishing/message/raw.rb', line 17 def publish Rabbit.publish() notify! end |