Class: ConsistentHashing::VirtualPoint
- Inherits:
-
Object
- Object
- ConsistentHashing::VirtualPoint
- Defined in:
- lib/consistent_hashing/virtual_point.rb
Overview
Public: represents a virtual point on the hash ring
Instance Attribute Summary collapse
-
#index ⇒ Object
Returns the value of attribute index.
-
#node ⇒ Object
readonly
Returns the value of attribute node.
Instance Method Summary collapse
-
#initialize(node, index) ⇒ VirtualPoint
constructor
A new instance of VirtualPoint.
Constructor Details
#initialize(node, index) ⇒ VirtualPoint
Returns a new instance of VirtualPoint.
8 9 10 11 |
# File 'lib/consistent_hashing/virtual_point.rb', line 8 def initialize(node, index) @node = node @index = index.to_i end |
Instance Attribute Details
#index ⇒ Object
Returns the value of attribute index.
6 7 8 |
# File 'lib/consistent_hashing/virtual_point.rb', line 6 def index @index end |
#node ⇒ Object (readonly)
Returns the value of attribute node.
6 7 8 |
# File 'lib/consistent_hashing/virtual_point.rb', line 6 def node @node end |