Class: Kafka::Protocol::SaslHandshakeResponse

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

Overview

SaslHandshake Response (Version: 0) => error_code [enabled_mechanisms]

error_code => int16
enabled_mechanisms => array of strings

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(error_code:, enabled_mechanisms:) ⇒ SaslHandshakeResponse

Returns a new instance of SaslHandshakeResponse.



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

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

Instance Attribute Details

#enabled_mechanismsObject (readonly)

Returns the value of attribute enabled_mechanisms.



13
14
15
# File 'lib/kafka/protocol/sasl_handshake_response.rb', line 13

def enabled_mechanisms
  @enabled_mechanisms
end

#error_codeObject (readonly)

Returns the value of attribute error_code.



11
12
13
# File 'lib/kafka/protocol/sasl_handshake_response.rb', line 11

def error_code
  @error_code
end

Class Method Details

.decode(decoder) ⇒ Object



20
21
22
23
24
25
# File 'lib/kafka/protocol/sasl_handshake_response.rb', line 20

def self.decode(decoder)
  new(
    error_code: decoder.int16,
    enabled_mechanisms: decoder.array { decoder.string }
  )
end