Class: KafkaSyrup::Protocol::OffsetRequest::Topic

Inherits:
Struct
  • Object
show all
Defined in:
lib/kafka_syrup/protocol/offset_request.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#nameObject

Returns the value of attribute name

Returns:

  • (Object)

    the current value of name



27
28
29
# File 'lib/kafka_syrup/protocol/offset_request.rb', line 27

def name
  @name
end

#partitionsObject

Returns the value of attribute partitions

Returns:

  • (Object)

    the current value of 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

#encodeObject



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