Class: Aerospike::Host
- Inherits:
-
Object
- Object
- Aerospike::Host
- Defined in:
- lib/aerospike/host.rb,
lib/aerospike/host/parse.rb more...
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
permalink #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
permalink #name ⇒ Object
Returns the value of attribute name.
23 24 25 |
# File 'lib/aerospike/host.rb', line 23 def name @name end |
permalink #port ⇒ Object
Returns the value of attribute port.
23 24 25 |
# File 'lib/aerospike/host.rb', line 23 def port @port end |
permalink #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
permalink #==(other) ⇒ Object Also known as: eql?
[View source]
36 37 38 |
# File 'lib/aerospike/host.rb', line 36 def ==(other) other && other.is_a?(Host) && other.name == @name && other.port == @port end |
permalink #hash ⇒ Object
[View source]
41 42 43 |
# File 'lib/aerospike/host.rb', line 41 def hash to_s.hash end |
permalink #to_s ⇒ Object Also known as: inspect
[View source]
31 32 33 |
# File 'lib/aerospike/host.rb', line 31 def to_s "#{@name}:#{@port}" end |