Class: TableSync::Publishing::Message::Batch

Inherits:
Base
  • Object
show all
Defined in:
lib/table_sync/publishing/message/batch.rb

Instance Attribute Summary collapse

Attributes inherited from Base

#custom_version, #event, #object_class, #objects, #original_attributes

Instance Method Summary collapse

Methods inherited from Base

#data, #empty?, #find_or_init_objects, #message_params, #model_naming, #notify!, #publish

Constructor Details

#initialize(params = {}) ⇒ Batch

Returns a new instance of Batch.



7
8
9
10
11
12
# File 'lib/table_sync/publishing/message/batch.rb', line 7

def initialize(params = {})
  super

  self.headers     = params[:headers]
  self.routing_key = params[:routing_key]
end

Instance Attribute Details

#headersObject

Returns the value of attribute headers.



5
6
7
# File 'lib/table_sync/publishing/message/batch.rb', line 5

def headers
  @headers
end

#routing_keyObject

Returns the value of attribute routing_key.



5
6
7
# File 'lib/table_sync/publishing/message/batch.rb', line 5

def routing_key
  @routing_key
end

Instance Method Details

#paramsObject



14
15
16
17
18
# File 'lib/table_sync/publishing/message/batch.rb', line 14

def params
  TableSync::Publishing::Params::Batch.new(
    { object_class:, headers:, routing_key: }.compact,
  ).construct
end