Class: ConsistentHashing::VirtualPoint

Inherits:
Object
  • Object
show all
Defined in:
lib/consistent_hashing/virtual_point.rb

Overview

Public: represents a virtual point on the hash ring

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#indexObject

Returns the value of attribute index.



6
7
8
# File 'lib/consistent_hashing/virtual_point.rb', line 6

def index
  @index
end

#nodeObject (readonly)

Returns the value of attribute node.



6
7
8
# File 'lib/consistent_hashing/virtual_point.rb', line 6

def node
  @node
end