Class: Kafka::Protocol::JoinGroupResponse

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(error_code:, generation_id:, group_protocol:, leader_id:, member_id:, members:) ⇒ JoinGroupResponse

Returns a new instance of JoinGroupResponse.


10
11
12
13
14
15
16
17
# File 'lib/kafka/protocol/join_group_response.rb', line 10

def initialize(error_code:, generation_id:, group_protocol:, leader_id:, member_id:, members:)
  @error_code = error_code
  @generation_id = generation_id
  @group_protocol = group_protocol
  @leader_id = leader_id
  @member_id = member_id
  @members = members
end

Instance Attribute Details

#error_codeObject (readonly)

Returns the value of attribute error_code


4
5
6
# File 'lib/kafka/protocol/join_group_response.rb', line 4

def error_code
  @error_code
end

#generation_idObject (readonly)

Returns the value of attribute generation_id


6
7
8
# File 'lib/kafka/protocol/join_group_response.rb', line 6

def generation_id
  @generation_id
end

#group_protocolObject (readonly)

Returns the value of attribute group_protocol


6
7
8
# File 'lib/kafka/protocol/join_group_response.rb', line 6

def group_protocol
  @group_protocol
end

#leader_idObject (readonly)

Returns the value of attribute leader_id


8
9
10
# File 'lib/kafka/protocol/join_group_response.rb', line 8

def leader_id
  @leader_id
end

#member_idObject (readonly)

Returns the value of attribute member_id


8
9
10
# File 'lib/kafka/protocol/join_group_response.rb', line 8

def member_id
  @member_id
end

#membersObject (readonly)

Returns the value of attribute members


8
9
10
# File 'lib/kafka/protocol/join_group_response.rb', line 8

def members
  @members
end

Class Method Details

.decode(decoder) ⇒ Object


19
20
21
22
23
24
25
26
27
28
# File 'lib/kafka/protocol/join_group_response.rb', line 19

def self.decode(decoder)
  new(
    error_code: decoder.int16,
    generation_id: decoder.int32,
    group_protocol: decoder.string,
    leader_id: decoder.string,
    member_id: decoder.string,
    members: Hash[decoder.array { [decoder.string, decoder.bytes] }],
  )
end