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