Class: Aerospike::Host
- Inherits:
-
Object
- Object
- Aerospike::Host
- Defined in:
- lib/aerospike/host.rb,
lib/aerospike/host/parse.rb
Defined Under Namespace
Modules: Parse
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
-
#port ⇒ Object
Returns the value of attribute port.
-
#tls_name ⇒ Object
Returns the value of attribute tls_name.
Instance Method Summary collapse
- #==(other) ⇒ Object (also: #eql?)
- #hash ⇒ Object
-
#initialize(host_name, host_port, tls_name = nil) ⇒ Host
constructor
A new instance of Host.
- #to_s ⇒ Object (also: #inspect)
Constructor Details
#initialize(host_name, host_port, tls_name = nil) ⇒ Host
Returns a new instance of Host.
25 26 27 28 29 |
# File 'lib/aerospike/host.rb', line 25 def initialize(host_name, host_port, tls_name = nil) @name = host_name @port = host_port @tls_name = tls_name end |
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name.
23 24 25 |
# File 'lib/aerospike/host.rb', line 23 def name @name end |
#port ⇒ Object
Returns the value of attribute port.
23 24 25 |
# File 'lib/aerospike/host.rb', line 23 def port @port end |
#tls_name ⇒ Object
Returns the value of attribute tls_name.
23 24 25 |
# File 'lib/aerospike/host.rb', line 23 def tls_name @tls_name end |
Instance Method Details
#==(other) ⇒ Object Also known as: eql?
36 37 38 |
# File 'lib/aerospike/host.rb', line 36 def ==(other) other && other.is_a?(Host) && other.name == @name && other.port == @port end |
#hash ⇒ Object
41 42 43 |
# File 'lib/aerospike/host.rb', line 41 def hash to_s.hash end |
#to_s ⇒ Object Also known as: inspect
31 32 33 |
# File 'lib/aerospike/host.rb', line 31 def to_s "#{@name}:#{@port}" end |