Class: KafkaSyrup::Protocol::OffsetRequest::Topic
- Inherits:
-
Struct
- Object
- Struct
- KafkaSyrup::Protocol::OffsetRequest::Topic
- Defined in:
- lib/kafka_syrup/protocol/offset_request.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
-
#partitions ⇒ Object
Returns the value of attribute partitions.
Instance Method Summary collapse
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name
27 28 29 |
# File 'lib/kafka_syrup/protocol/offset_request.rb', line 27 def name @name end |
#partitions ⇒ Object
Returns the value of attribute partitions
27 28 29 |
# File 'lib/kafka_syrup/protocol/offset_request.rb', line 27 def partitions @partitions end |
Instance Method Details
#add_partition(id, time = -1,, max_offsets = 1) ⇒ Object
28 29 30 31 32 |
# File 'lib/kafka_syrup/protocol/offset_request.rb', line 28 def add_partition(id, time = -1, max_offsets = 1) partition = Partition.new(id, time, max_offsets) partitions << partition partition end |
#encode ⇒ Object
34 35 36 37 38 39 |
# File 'lib/kafka_syrup/protocol/offset_request.rb', line 34 def encode [ E.write_string(name), E.write_array(partitions) ].join end |