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.
167 168 169 170 171 172 |
# File 'lib/data_structures/linked_list.rb', line 167 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
178 179 180 |
# File 'lib/data_structures/linked_list.rb', line 178 def inspect @val end |
#to_s ⇒ Object
174 175 176 |
# File 'lib/data_structures/linked_list.rb', line 174 def to_s @val end |