Class: DistributedMarshaledRedis
- Inherits:
-
DistRedis
- Object
- DistRedis
- DistributedMarshaledRedis
- Defined in:
- lib/redis/distributed_marshaled_redis.rb
Instance Attribute Summary collapse
-
#ring ⇒ Object
readonly
Returns the value of attribute ring.
Instance Method Summary collapse
-
#initialize(addresses) ⇒ DistributedMarshaledRedis
constructor
A new instance of DistributedMarshaledRedis.
- #nodes ⇒ Object
Constructor Details
#initialize(addresses) ⇒ DistributedMarshaledRedis
Returns a new instance of DistributedMarshaledRedis.
4 5 6 7 8 9 |
# File 'lib/redis/distributed_marshaled_redis.rb', line 4 def initialize(addresses) nodes = addresses.map do |address| MarshaledRedis.new address end @ring = Redis::HashRing.new nodes end |
Instance Attribute Details
#ring ⇒ Object (readonly)
Returns the value of attribute ring.
2 3 4 |
# File 'lib/redis/distributed_marshaled_redis.rb', line 2 def ring @ring end |
Instance Method Details
#nodes ⇒ Object
11 12 13 |
# File 'lib/redis/distributed_marshaled_redis.rb', line 11 def nodes ring.nodes end |