Class: Kafka::PendingMessage
- Inherits:
-
Object
- Object
- Kafka::PendingMessage
- Defined in:
- lib/kafka/pending_message.rb
Instance Attribute Summary collapse
-
#bytesize ⇒ Object
readonly
Returns the value of attribute bytesize.
-
#create_time ⇒ Object
readonly
Returns the value of attribute create_time.
-
#headers ⇒ Object
readonly
Returns the value of attribute headers.
-
#key ⇒ Object
readonly
Returns the value of attribute key.
-
#partition ⇒ Object
readonly
Returns the value of attribute partition.
-
#partition_key ⇒ Object
readonly
Returns the value of attribute partition_key.
-
#topic ⇒ Object
readonly
Returns the value of attribute topic.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(value:, key:, headers: {}, topic:, partition:, partition_key:, create_time:) ⇒ PendingMessage
constructor
A new instance of PendingMessage.
Constructor Details
#initialize(value:, key:, headers: {}, topic:, partition:, partition_key:, create_time:) ⇒ PendingMessage
Returns a new instance of PendingMessage.
7 8 9 10 11 12 13 14 15 16 |
# File 'lib/kafka/pending_message.rb', line 7 def initialize(value:, key:, headers: {}, topic:, partition:, partition_key:, create_time:) @value = value @key = key @headers = headers @topic = topic @partition = partition @partition_key = partition_key @create_time = create_time @bytesize = key.to_s.bytesize + value.to_s.bytesize end |
Instance Attribute Details
#bytesize ⇒ Object (readonly)
Returns the value of attribute bytesize.
5 6 7 |
# File 'lib/kafka/pending_message.rb', line 5 def bytesize @bytesize end |
#create_time ⇒ Object (readonly)
Returns the value of attribute create_time.
5 6 7 |
# File 'lib/kafka/pending_message.rb', line 5 def create_time @create_time end |
#headers ⇒ Object (readonly)
Returns the value of attribute headers.
5 6 7 |
# File 'lib/kafka/pending_message.rb', line 5 def headers @headers end |
#key ⇒ Object (readonly)
Returns the value of attribute key.
5 6 7 |
# File 'lib/kafka/pending_message.rb', line 5 def key @key end |
#partition ⇒ Object (readonly)
Returns the value of attribute partition.
5 6 7 |
# File 'lib/kafka/pending_message.rb', line 5 def partition @partition end |
#partition_key ⇒ Object (readonly)
Returns the value of attribute partition_key.
5 6 7 |
# File 'lib/kafka/pending_message.rb', line 5 def partition_key @partition_key end |
#topic ⇒ Object (readonly)
Returns the value of attribute topic.
5 6 7 |
# File 'lib/kafka/pending_message.rb', line 5 def topic @topic end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
5 6 7 |
# File 'lib/kafka/pending_message.rb', line 5 def value @value end |
Instance Method Details
#==(other) ⇒ Object
18 19 20 21 22 23 24 25 26 27 |
# File 'lib/kafka/pending_message.rb', line 18 def ==(other) @value == other.value && @key == other.key && @topic == other.topic && @headers == other.headers && @partition == other.partition && @partition_key == other.partition_key && @create_time == other.create_time && @bytesize == other.bytesize end |