Ruby implementation of a linked list