Class: RedisRing::Client::ShardMetaData
- Inherits:
-
Object
- Object
- RedisRing::Client::ShardMetaData
- Defined in:
- lib/redis_ring/client/ring_meta_data.rb
Instance Attribute Summary collapse
-
#host ⇒ Object
readonly
Returns the value of attribute host.
-
#port ⇒ Object
readonly
Returns the value of attribute port.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(host, port, status) ⇒ ShardMetaData
constructor
A new instance of ShardMetaData.
- #to_sym ⇒ Object
Constructor Details
#initialize(host, port, status) ⇒ ShardMetaData
Returns a new instance of ShardMetaData.
72 73 74 75 76 77 |
# File 'lib/redis_ring/client/ring_meta_data.rb', line 72 def initialize(host, port, status) @host = host @port = port @status = status @sym = :"Redis<#{host}:#{port}>" end |
Instance Attribute Details
#host ⇒ Object (readonly)
Returns the value of attribute host.
70 71 72 |
# File 'lib/redis_ring/client/ring_meta_data.rb', line 70 def host @host end |
#port ⇒ Object (readonly)
Returns the value of attribute port.
70 71 72 |
# File 'lib/redis_ring/client/ring_meta_data.rb', line 70 def port @port end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
70 71 72 |
# File 'lib/redis_ring/client/ring_meta_data.rb', line 70 def status @status end |
Class Method Details
.from_json(hash) ⇒ Object
79 80 81 |
# File 'lib/redis_ring/client/ring_meta_data.rb', line 79 def self.from_json(hash) new(hash['host'], hash['port'].to_i, hash['status'].to_sym) end |
Instance Method Details
#to_sym ⇒ Object
83 84 85 |
# File 'lib/redis_ring/client/ring_meta_data.rb', line 83 def to_sym @sym end |