Class: Kafka::Protocol::ApiVersionsResponse::ApiInfo
- Inherits:
-
Object
- Object
- Kafka::Protocol::ApiVersionsResponse::ApiInfo
- Defined in:
- lib/kafka/protocol/api_versions_response.rb
Instance Attribute Summary collapse
-
#api_key ⇒ Object
readonly
Returns the value of attribute api_key.
-
#max_version ⇒ Object
readonly
Returns the value of attribute max_version.
-
#min_version ⇒ Object
readonly
Returns the value of attribute min_version.
Instance Method Summary collapse
- #api_name ⇒ Object
-
#initialize(api_key:, min_version:, max_version:) ⇒ ApiInfo
constructor
A new instance of ApiInfo.
- #inspect ⇒ Object
- #to_s ⇒ Object
- #version_supported?(version) ⇒ Boolean
Constructor Details
#initialize(api_key:, min_version:, max_version:) ⇒ ApiInfo
Returns a new instance of ApiInfo.
10 11 12 |
# File 'lib/kafka/protocol/api_versions_response.rb', line 10 def initialize(api_key:, min_version:, max_version:) @api_key, @min_version, @max_version = api_key, min_version, max_version end |
Instance Attribute Details
#api_key ⇒ Object (readonly)
Returns the value of attribute api_key.
8 9 10 |
# File 'lib/kafka/protocol/api_versions_response.rb', line 8 def api_key @api_key end |
#max_version ⇒ Object (readonly)
Returns the value of attribute max_version.
8 9 10 |
# File 'lib/kafka/protocol/api_versions_response.rb', line 8 def max_version @max_version end |
#min_version ⇒ Object (readonly)
Returns the value of attribute min_version.
8 9 10 |
# File 'lib/kafka/protocol/api_versions_response.rb', line 8 def min_version @min_version end |
Instance Method Details
#api_name ⇒ Object
14 15 16 |
# File 'lib/kafka/protocol/api_versions_response.rb', line 14 def api_name Protocol.api_name(api_key) end |
#inspect ⇒ Object
26 27 28 |
# File 'lib/kafka/protocol/api_versions_response.rb', line 26 def inspect "#<Kafka api version #{to_s}>" end |
#to_s ⇒ Object
22 23 24 |
# File 'lib/kafka/protocol/api_versions_response.rb', line 22 def to_s "#{api_name}=#{min_version}..#{max_version}" end |
#version_supported?(version) ⇒ Boolean
18 19 20 |
# File 'lib/kafka/protocol/api_versions_response.rb', line 18 def version_supported?(version) (min_version..max_version).include?(version) end |