Class: LinkedListNode
- Inherits:
-
Object
- Object
- LinkedListNode
- Defined in:
- lib/data_structures/linked_list.rb
Instance Method Summary collapse
-
#initialize(key = nil, val = nil, next_node = nil, prev_node = nil) ⇒ LinkedListNode
constructor
A new instance of LinkedListNode.
- #inspect ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(key = nil, val = nil, next_node = nil, prev_node = nil) ⇒ LinkedListNode
Returns a new instance of LinkedListNode.
156 157 158 159 160 161 |
# File 'lib/data_structures/linked_list.rb', line 156 def initialize(key=nil, val=nil, next_node=nil, prev_node=nil) @key = key @val = val @next = next_node @prev = prev_node end |
Instance Method Details
#inspect ⇒ Object
167 168 169 |
# File 'lib/data_structures/linked_list.rb', line 167 def inspect @val end |
#to_s ⇒ Object
163 164 165 |
# File 'lib/data_structures/linked_list.rb', line 163 def to_s @val end |