Class: KafkaSyrup::Protocol::OffsetRequest
- Defined in:
- lib/kafka_syrup/protocol/offset_request.rb
Defined Under Namespace
Instance Attribute Summary collapse
-
#topics ⇒ Object
Returns the value of attribute topics.
Attributes inherited from Request
Instance Method Summary collapse
Methods inherited from Request
#api_key, #api_version, #initialize
Methods inherited from Base
#==, #config, #decode, #initialize
Methods included from Utils
Constructor Details
This class inherits a constructor from KafkaSyrup::Protocol::Request
Instance Attribute Details
#topics ⇒ Object
Returns the value of attribute topics.
6 7 8 |
# File 'lib/kafka_syrup/protocol/offset_request.rb', line 6 def topics @topics end |
Instance Method Details
#add_topic(name) ⇒ Object
12 13 14 15 16 |
# File 'lib/kafka_syrup/protocol/offset_request.rb', line 12 def add_topic(name) topic = Topic.new(name, []) topics << topic topic end |
#defaults ⇒ Object
8 9 10 |
# File 'lib/kafka_syrup/protocol/offset_request.rb', line 8 def defaults { topics: [] } end |
#encode ⇒ Object
18 19 20 21 22 23 24 25 |
# File 'lib/kafka_syrup/protocol/offset_request.rb', line 18 def encode super do [ E.write_int32(REPLICA_ID), E.write_array(topics) ].join end end |