Class: KafkaSyrup::Protocol::FetchRequest::Topic
- Inherits:
-
Struct
- Object
- Struct
- KafkaSyrup::Protocol::FetchRequest::Topic
- Defined in:
- lib/kafka_syrup/protocol/fetch_request.rb
Instance Attribute Summary collapse
-
#max_bytes ⇒ Object
Returns the value of attribute max_bytes.
-
#name ⇒ Object
Returns the value of attribute name.
-
#partitions ⇒ Object
Returns the value of attribute partitions.
Instance Method Summary collapse
Instance Attribute Details
#max_bytes ⇒ Object
Returns the value of attribute max_bytes
34 35 36 |
# File 'lib/kafka_syrup/protocol/fetch_request.rb', line 34 def max_bytes @max_bytes end |
#name ⇒ Object
Returns the value of attribute name
34 35 36 |
# File 'lib/kafka_syrup/protocol/fetch_request.rb', line 34 def name @name end |
#partitions ⇒ Object
Returns the value of attribute partitions
34 35 36 |
# File 'lib/kafka_syrup/protocol/fetch_request.rb', line 34 def partitions @partitions end |
Instance Method Details
#add_partition(id, offset) ⇒ Object
35 36 37 38 39 |
# File 'lib/kafka_syrup/protocol/fetch_request.rb', line 35 def add_partition(id, offset) partition = Partition.new(id, offset, max_bytes) partitions << partition partition end |
#encode ⇒ Object
41 42 43 44 45 46 |
# File 'lib/kafka_syrup/protocol/fetch_request.rb', line 41 def encode [ E.write_string(name), E.write_array(partitions) ].join end |