Class: Dalli::Elasticache::AutoDiscovery::Node
- Inherits:
-
Object
- Object
- Dalli::Elasticache::AutoDiscovery::Node
- Defined in:
- lib/dalli/elasticache/auto_discovery/node.rb
Overview
Represents a single memcached node in the cluster.
Instance Attribute Summary collapse
-
#host ⇒ Object
readonly
Returns the value of attribute host.
-
#ip ⇒ Object
readonly
Returns the value of attribute ip.
-
#port ⇒ Object
readonly
Returns the value of attribute port.
Instance Method Summary collapse
- #==(other) ⇒ Object
- #eql?(other) ⇒ Boolean
- #hash ⇒ Object
-
#initialize(host, ip, port) ⇒ Node
constructor
A new instance of Node.
- #to_s ⇒ Object
Constructor Details
#initialize(host, ip, port) ⇒ Node
Returns a new instance of Node.
13 14 15 16 17 |
# File 'lib/dalli/elasticache/auto_discovery/node.rb', line 13 def initialize(host, ip, port) @host = host @ip = ip @port = port end |
Instance Attribute Details
#host ⇒ Object (readonly)
Returns the value of attribute host.
11 12 13 |
# File 'lib/dalli/elasticache/auto_discovery/node.rb', line 11 def host @host end |
#ip ⇒ Object (readonly)
Returns the value of attribute ip.
11 12 13 |
# File 'lib/dalli/elasticache/auto_discovery/node.rb', line 11 def ip @ip end |
#port ⇒ Object (readonly)
Returns the value of attribute port.
11 12 13 |
# File 'lib/dalli/elasticache/auto_discovery/node.rb', line 11 def port @port end |
Instance Method Details
#==(other) ⇒ Object
19 20 21 22 23 |
# File 'lib/dalli/elasticache/auto_discovery/node.rb', line 19 def ==(other) host == other.host && ip == other.ip && port == other.port end |
#eql?(other) ⇒ Boolean
25 26 27 |
# File 'lib/dalli/elasticache/auto_discovery/node.rb', line 25 def eql?(other) self == other end |
#hash ⇒ Object
29 30 31 |
# File 'lib/dalli/elasticache/auto_discovery/node.rb', line 29 def hash [host, ip, port].hash end |
#to_s ⇒ Object
33 34 35 |
# File 'lib/dalli/elasticache/auto_discovery/node.rb', line 33 def to_s "#{@host}:#{@port}" end |