Class: Phobos::BatchMessage

Inherits:
Object
  • Object
show all
Defined in:
lib/phobos/batch_message.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(key:, partition:, offset:, payload:, headers:) ⇒ BatchMessage

Returns a new instance of BatchMessage.



7
8
9
10
11
12
13
# File 'lib/phobos/batch_message.rb', line 7

def initialize(key:, partition:, offset:, payload:, headers:)
  @key = key
  @partition = partition
  @offset = offset
  @payload = payload
  @headers = headers
end

Instance Attribute Details

#headersObject

Returns the value of attribute headers.



5
6
7
# File 'lib/phobos/batch_message.rb', line 5

def headers
  @headers
end

#keyObject

Returns the value of attribute key.



5
6
7
# File 'lib/phobos/batch_message.rb', line 5

def key
  @key
end

#offsetObject

Returns the value of attribute offset.



5
6
7
# File 'lib/phobos/batch_message.rb', line 5

def offset
  @offset
end

#partitionObject

Returns the value of attribute partition.



5
6
7
# File 'lib/phobos/batch_message.rb', line 5

def partition
  @partition
end

#payloadObject

Returns the value of attribute payload.



5
6
7
# File 'lib/phobos/batch_message.rb', line 5

def payload
  @payload
end

Instance Method Details

#==(other) ⇒ Object



15
16
17
18
19
# File 'lib/phobos/batch_message.rb', line 15

def ==(other)
  [:key, :partition, :offset, :payload, :headers].all? do |s|
    public_send(s) == other.public_send(s)
  end
end