Class: ListaHija

Inherits:
Lista show all
Defined in:
lib/referencia/listahija.rb

Overview

Clase que hereda de la Lista doble y sobre escribe el metodo each, ya que se comporta ligeramente diferente al original

Instance Attribute Summary

Attributes inherited from Lista

#fin, #inicio, #tamanio

Instance Method Summary collapse

Methods inherited from Lista

#extraerPrimerElemento, #extraerUltimoElemento, #insertar_final, #insertar_inicio, #mostar_fin_inicio, #mostar_inicio_fin

Constructor Details

#initializeListaHija

Returns a new instance of ListaHija.



3
4
5
# File 'lib/referencia/listahija.rb', line 3

def initialize
  super
end

Instance Method Details

#eachObject



6
7
8
9
10
11
12
# File 'lib/referencia/listahija.rb', line 6

def each
  aux =self.inicio
  while aux != nil do
    yield aux.value.to_s
    aux = aux.next
  end
end