Method: LinkedList::Node#to_list

Defined in:
lib/linked_lists/linked_list/node.rb

#to_listLinkedList

Set this node as the head of a new linked list.

Returns:



57
58
59
60
61
# File 'lib/linked_lists/linked_list/node.rb', line 57

def to_list
  list = LinkedList.new
  list.head = self
  list
end