Class: Kafka::Protocol::SaslHandshakeResponse
- Inherits:
-
Object
- Object
- Kafka::Protocol::SaslHandshakeResponse
- 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
-
#enabled_mechanisms ⇒ Object
readonly
Returns the value of attribute enabled_mechanisms.
-
#error_code ⇒ Object
readonly
Returns the value of attribute error_code.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(error_code:, enabled_mechanisms:) ⇒ SaslHandshakeResponse
constructor
A new instance of SaslHandshakeResponse.
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_mechanisms ⇒ Object (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_code ⇒ Object (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 |