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.



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

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.



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

def error_code
  @error_code
end

#generation_idObject (readonly)

Returns the value of attribute generation_id.



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

def generation_id
  @generation_id
end

#group_protocolObject (readonly)

Returns the value of attribute group_protocol.



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

def group_protocol
  @group_protocol
end

#leader_idObject (readonly)

Returns the value of attribute leader_id.



10
11
12
# File 'lib/kafka/protocol/join_group_response.rb', line 10

def leader_id
  @leader_id
end

#member_idObject (readonly)

Returns the value of attribute member_id.



10
11
12
# File 'lib/kafka/protocol/join_group_response.rb', line 10

def member_id
  @member_id
end

#membersObject (readonly)

Returns the value of attribute members.



10
11
12
# File 'lib/kafka/protocol/join_group_response.rb', line 10

def members
  @members
end

Class Method Details

.decode(decoder) ⇒ Object



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

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