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.



33
34
35
36
# File 'lib/kafka/protocol/api_versions_response.rb', line 33

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

Instance Attribute Details

#apisObject (readonly)

Returns the value of attribute apis.



31
32
33
# File 'lib/kafka/protocol/api_versions_response.rb', line 31

def apis
  @apis
end

#error_codeObject (readonly)

Returns the value of attribute error_code.



31
32
33
# File 'lib/kafka/protocol/api_versions_response.rb', line 31

def error_code
  @error_code
end

Class Method Details

.decode(decoder) ⇒ Object



38
39
40
41
42
43
44
45
46
47
48
49
50
# File 'lib/kafka/protocol/api_versions_response.rb', line 38

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