class Lista def initialize @beginning = @tail nil end def add (valor) nodo = Nodo.new(valor) @beginning = nodo if @beggining.nil? @tail.next = node unless @tail.nil? @tail = node end end class Nodo def initialize(value) @valor = valor @next = nil end def next @next end def next=(valor) @next = valor end end