Class: Aerospike::Host

Inherits:
Object
  • Object
show all
Defined in:
lib/aerospike/host.rb,
lib/aerospike/host/parse.rb

Defined Under Namespace

Modules: Parse

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#nameObject

Returns the value of attribute name.



23
24
25
# File 'lib/aerospike/host.rb', line 23

def name
  @name
end

#portObject

Returns the value of attribute port.



23
24
25
# File 'lib/aerospike/host.rb', line 23

def port
  @port
end

#tls_nameObject

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

#hashObject



41
42
43
# File 'lib/aerospike/host.rb', line 41

def hash
  to_s.hash
end

#to_sObject Also known as: inspect



31
32
33
# File 'lib/aerospike/host.rb', line 31

def to_s
  "#{@name}:#{@port}"
end