Method: Async::List#append

Defined in:
lib/async/list.rb

#append(node) ⇒ Object

Append a node to the end of the list.



57
58
59
60
61
62
63
64
65
66
67
68
# File 'lib/async/list.rb', line 57

def append(node)
  if node.head
    raise ArgumentError, "Node is already in a list!"
  end
  
  node.tail = self
  @head.tail = node
  node.head = @head
  @head = node
  
  return added(node)
end