Class: Kafka::Protocol::ListGroupsResponse

Inherits:
Object
  • Object
show all
Defined in:
lib/kafka/protocol/list_groups_response.rb

Defined Under Namespace

Classes: GroupEntry

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(error_code:, groups:) ⇒ ListGroupsResponse

Returns a new instance of ListGroupsResponse.



17
18
19
20
# File 'lib/kafka/protocol/list_groups_response.rb', line 17

def initialize(error_code:, groups:)
  @error_code = error_code
  @groups = groups
end

Instance Attribute Details

#error_codeObject (readonly)

Returns the value of attribute error_code.



15
16
17
# File 'lib/kafka/protocol/list_groups_response.rb', line 15

def error_code
  @error_code
end

#groupsObject (readonly)

Returns the value of attribute groups.



15
16
17
# File 'lib/kafka/protocol/list_groups_response.rb', line 15

def groups
  @groups
end

Class Method Details

.decode(decoder) ⇒ Object



22
23
24
25
26
27
28
29
30
31
32
# File 'lib/kafka/protocol/list_groups_response.rb', line 22

def self.decode(decoder)
  error_code = decoder.int16
  groups = decoder.array do
    GroupEntry.new(
      group_id: decoder.string,
      protocol_type: decoder.string
    )
  end

  new(error_code: error_code, groups: groups)
end