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:) ⇒ void

Parameters:

  • key
  • partition (Integer)
  • offset (Integer)
  • payload
  • headers


22
23
24
25
26
27
28
# File 'lib/phobos/batch_message.rb', line 22

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

Instance Attribute Details

#headersObject

Returns:



14
15
16
# File 'lib/phobos/batch_message.rb', line 14

def headers
  @headers
end

#keyObject

Returns:



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

def key
  @key
end

#offsetInteger

Returns:

  • (Integer)


10
11
12
# File 'lib/phobos/batch_message.rb', line 10

def offset
  @offset
end

#partitionInteger

Returns:

  • (Integer)


8
9
10
# File 'lib/phobos/batch_message.rb', line 8

def partition
  @partition
end

#payloadObject

Returns:



12
13
14
# File 'lib/phobos/batch_message.rb', line 12

def payload
  @payload
end

Instance Method Details

#==(other) ⇒ Boolean

Parameters:

Returns:

  • (Boolean)


32
33
34
35
36
# File 'lib/phobos/batch_message.rb', line 32

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