Class: KafkaSyrup::Protocol::OffsetResponse::Topic
- Inherits:
-
Struct
- Object
- Struct
- KafkaSyrup::Protocol::OffsetResponse::Topic
- Defined in:
- lib/kafka_syrup/protocol/offset_response.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
-
#partitions ⇒ Object
Returns the value of attribute partitions.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name
28 29 30 |
# File 'lib/kafka_syrup/protocol/offset_response.rb', line 28 def name @name end |
#partitions ⇒ Object
Returns the value of attribute partitions
28 29 30 |
# File 'lib/kafka_syrup/protocol/offset_response.rb', line 28 def partitions @partitions end |
Class Method Details
.decode(io) ⇒ Object
42 43 44 45 46 47 |
# File 'lib/kafka_syrup/protocol/offset_response.rb', line 42 def self.decode(io) new( E.read_string(io), # Name E.read_array(io, &Partition.method(:decode)), # Partitions ) end |
Instance Method Details
#add_partition(id, code, offsets) ⇒ Object
29 30 31 32 33 |
# File 'lib/kafka_syrup/protocol/offset_response.rb', line 29 def add_partition(id, code, offsets) partition = Partition.new(id, code, offsets) partitions << partition partition end |
#encode ⇒ Object
35 36 37 38 39 40 |
# File 'lib/kafka_syrup/protocol/offset_response.rb', line 35 def encode [ E.write_string(name), E.write_array(partitions) ].join end |