Class: KafkaSyrup::Protocol::FetchRequest::Topic

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#max_bytesObject

Returns the value of attribute max_bytes

Returns:

  • (Object)

    the current value of max_bytes



34
35
36
# File 'lib/kafka_syrup/protocol/fetch_request.rb', line 34

def max_bytes
  @max_bytes
end

#nameObject

Returns the value of attribute name

Returns:

  • (Object)

    the current value of name



34
35
36
# File 'lib/kafka_syrup/protocol/fetch_request.rb', line 34

def name
  @name
end

#partitionsObject

Returns the value of attribute partitions

Returns:

  • (Object)

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

#encodeObject



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