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.



39
40
41
42
43
# File 'lib/kafka/protocol/metadata_response.rb', line 39

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.



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

def host
  @host
end

#node_idObject (readonly)

Returns the value of attribute node_id.



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

def node_id
  @node_id
end

#portObject (readonly)

Returns the value of attribute port.



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

def port
  @port
end

Instance Method Details

#to_sObject



45
46
47
# File 'lib/kafka/protocol/metadata_response.rb', line 45

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