Class: Hashery::LinkedList::Node
Overview
Represents a single node of the linked list.
Instance Attribute Summary (collapse)
-
- (Object) key
Returns the value of attribute key.
-
- (Object) next_node
Returns the value of attribute next_node.
-
- (Object) prev_node
Returns the value of attribute prev_node.
-
- (Object) value
Returns the value of attribute value.
Instance Method Summary (collapse)
-
- (Node) initialize(key = nil, value = nil, prev_node = nil, next_node = nil)
constructor
A new instance of Node.
Constructor Details
- (Node) initialize(key = nil, value = nil, prev_node = nil, next_node = nil)
A new instance of Node
35 36 37 38 39 40 |
# File 'lib/hashery/linked_list.rb', line 35 def initialize(key=nil,value=nil,prev_node=nil,next_node=nil) @key = key @value = value @prev_node = prev_node @next_node = next_node end |
Instance Attribute Details
- (Object) key
Returns the value of attribute key
33 34 35 |
# File 'lib/hashery/linked_list.rb', line 33 def key @key end |
- (Object) next_node
Returns the value of attribute next_node
33 34 35 |
# File 'lib/hashery/linked_list.rb', line 33 def next_node @next_node end |
- (Object) prev_node
Returns the value of attribute prev_node
33 34 35 |
# File 'lib/hashery/linked_list.rb', line 33 def prev_node @prev_node end |
- (Object) value
Returns the value of attribute value
33 34 35 |
# File 'lib/hashery/linked_list.rb', line 33 def value @value end |