lib/consistent_hashing/ring.rb in consistent-hashing-0.2.1 vs lib/consistent_hashing/ring.rb in consistent-hashing-1.0.0
- old
+ new
@@ -29,13 +29,18 @@
# generate the key of this (virtual) point in the hash
key = hash_key(node, i)
@ring[key] = VirtualPoint.new(node, key)
end
+ end
+ # Public: adds a new node into the hash ring like `add` but returns
+ # a reference to the ring to be used as a fluent interface
+ #
+ def <<(node)
+ add(node)
self
end
- alias :<< :add
# Public: removes a node from the hash ring
#
def delete(node)
@replicas.times do |i|