Class: KafkaSyrup::Protocol::OffsetResponse::Partition
- Inherits:
-
Struct
- Object
- Struct
- KafkaSyrup::Protocol::OffsetResponse::Partition
- Defined in:
- lib/kafka_syrup/protocol/offset_response.rb
Instance Attribute Summary collapse
-
#code ⇒ Object
Returns the value of attribute code.
-
#id ⇒ Object
Returns the value of attribute id.
-
#offsets ⇒ Object
Returns the value of attribute offsets.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#code ⇒ Object
Returns the value of attribute code
50 51 52 |
# File 'lib/kafka_syrup/protocol/offset_response.rb', line 50 def code @code end |
#id ⇒ Object
Returns the value of attribute id
50 51 52 |
# File 'lib/kafka_syrup/protocol/offset_response.rb', line 50 def id @id end |
#offsets ⇒ Object
Returns the value of attribute offsets
50 51 52 |
# File 'lib/kafka_syrup/protocol/offset_response.rb', line 50 def offsets @offsets end |
Class Method Details
.decode(io) ⇒ Object
59 60 61 62 63 64 65 |
# File 'lib/kafka_syrup/protocol/offset_response.rb', line 59 def self.decode(io) new( E.read_int32(io), # ID E.read_int16(io), # Error Code E.read_array(io, &E.method(:read_int64)) # Offsets ) end |
Instance Method Details
#encode ⇒ Object
51 52 53 54 55 56 57 |
# File 'lib/kafka_syrup/protocol/offset_response.rb', line 51 def encode [ E.write_int32(id), E.write_int16(code), E.write_array(offsets, &E.method(:write_int64)) ].join end |