Class: DSkipList::Node
- Inherits:
-
Object
- Object
- DSkipList::Node
- Defined in:
- lib/dskiplist.rb
Instance Attribute Summary collapse
-
#forward ⇒ Object
Returns the value of attribute forward.
-
#key ⇒ Object
Returns the value of attribute key.
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(k, v = nil) ⇒ Node
constructor
A new instance of Node.
Constructor Details
#initialize(k, v = nil) ⇒ Node
Returns a new instance of Node.
35 36 37 38 39 40 |
# File 'lib/dskiplist.rb', line 35 def initialize(k, v = nil) @key = k @value = v.nil? ? k : v @forward = [] end |
Instance Attribute Details
#forward ⇒ Object
Returns the value of attribute forward.
33 34 35 |
# File 'lib/dskiplist.rb', line 33 def forward @forward end |
#key ⇒ Object
Returns the value of attribute key.
31 32 33 |
# File 'lib/dskiplist.rb', line 31 def key @key end |
#value ⇒ Object
Returns the value of attribute value.
32 33 34 |
# File 'lib/dskiplist.rb', line 32 def value @value end |