Class: Kafka::Protocol::ApiVersionsResponse

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

Defined Under Namespace

Classes: ApiInfo

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(error_code:, apis:) ⇒ ApiVersionsResponse

Returns a new instance of ApiVersionsResponse.



27
28
29
30
# File 'lib/kafka/protocol/api_versions_response.rb', line 27

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

Instance Attribute Details

#apisObject (readonly)

Returns the value of attribute apis.



25
26
27
# File 'lib/kafka/protocol/api_versions_response.rb', line 25

def apis
  @apis
end

#error_codeObject (readonly)

Returns the value of attribute error_code.



25
26
27
# File 'lib/kafka/protocol/api_versions_response.rb', line 25

def error_code
  @error_code
end

Class Method Details

.decode(decoder) ⇒ Object



32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'lib/kafka/protocol/api_versions_response.rb', line 32

def self.decode(decoder)
  error_code = decoder.int16

  apis = decoder.array do
    ApiInfo.new(
      api_key: decoder.int16,
      min_version: decoder.int16,
      max_version: decoder.int16,
    )
  end

  new(error_code: error_code, apis: apis)
end