Class: GrupoAlimento

Inherits:
DoubleList show all
Defined in:
lib/menu/GrupoAlimento.rb

Instance Attribute Summary collapse

Attributes inherited from DoubleList

#tail

Attributes inherited from Lista

#head, #size

Instance Method Summary collapse

Methods inherited from DoubleList

#each, #extraerHead, #insert

Methods inherited from Lista

#extraerHead, #insert

Constructor Details

#initialize(nodo, tipo) ⇒ GrupoAlimento

Returns a new instance of GrupoAlimento.



4
5
6
7
8
9
10
# File 'lib/menu/GrupoAlimento.rb', line 4

def initialize(nodo, tipo)
    @head = nodo
    @size = 1
    @tail = nodo  
    @head.prev = nil
    @tipo = tipo
end

Instance Attribute Details

#tipoObject

Returns the value of attribute tipo.



3
4
5
# File 'lib/menu/GrupoAlimento.rb', line 3

def tipo
  @tipo
end

Instance Method Details

#to_sObject



11
12
13
14
15
# File 'lib/menu/GrupoAlimento.rb', line 11

def to_s
    s = ""
    s << "#{@tipo}\n"
    s << super.to_s
end