Class: AGrupos

Inherits:
Alimentos show all
Defined in:
lib/alimento.rb

Instance Attribute Summary collapse

Attributes inherited from Alimentos

#glucidos, #lipidos, #nombre, #proteinas

Instance Method Summary collapse

Methods inherited from Alimentos

#<=>, #ve

Constructor Details

#initialize(nombre, proteinas, glucidos, lipidos, ngrupo) ⇒ AGrupos

Returns a new instance of AGrupos



37
38
39
40
# File 'lib/alimento.rb', line 37

def initialize(nombre,proteinas,glucidos,lipidos,ngrupo)
    super(nombre,proteinas,glucidos,lipidos)
    @ngrupo = ngrupo
end

Instance Attribute Details

#ngrupoObject (readonly)

Returns the value of attribute ngrupo



35
36
37
# File 'lib/alimento.rb', line 35

def ngrupo
  @ngrupo
end

Instance Method Details

#to_sObject



42
43
44
45
46
# File 'lib/alimento.rb', line 42

def to_s
    s = "Grupo: #{@ngrupo}\n"
    s << super.to_s
    s
end