Class: Kafka::Protocol::MetadataResponse::BrokerInfo

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(node_id:, host:, port:) ⇒ BrokerInfo

Returns a new instance of BrokerInfo.



37
38
39
40
41
# File 'lib/kafka/protocol/metadata_response.rb', line 37

def initialize(node_id:, host:, port:)
  @node_id = node_id
  @host = host
  @port = port
end

Instance Attribute Details

#hostObject (readonly)

Returns the value of attribute host.



35
36
37
# File 'lib/kafka/protocol/metadata_response.rb', line 35

def host
  @host
end

#node_idObject (readonly)

Returns the value of attribute node_id.



35
36
37
# File 'lib/kafka/protocol/metadata_response.rb', line 35

def node_id
  @node_id
end

#portObject (readonly)

Returns the value of attribute port.



35
36
37
# File 'lib/kafka/protocol/metadata_response.rb', line 35

def port
  @port
end

Instance Method Details

#to_sObject



43
44
45
# File 'lib/kafka/protocol/metadata_response.rb', line 43

def to_s
  "#{host}:#{port} (node_id=#{node_id})"
end