Class: MenuFood

Inherits:
Diet
  • Object
show all
Defined in:
lib/prct06/menuFood.rb

Instance Attribute Summary collapse

Attributes inherited from Diet

#dip, #pchdt, #pfts, #pprtn, #rcps, #ttl, #vct

Instance Method Summary collapse

Methods inherited from Diet

#<=>, #new_recipe

Constructor Details

#initialize(food, ttl, dip, vct, pprtn, pfts, pchdt) ⇒ MenuFood

Returns a new instance of MenuFood

Parameters:

  • Grupo (String)

    de alimentos, [String] Título, [String] Ingesta diaria, [String] Valor calorífico,

  • Porcentaje (String)

    de proteínas, [String] Porcentaje de proteínas, [String] Porcentaje de grasas

  • Porcentaje (String)

    de hidratos de carbono



26
27
28
29
30
31
32
# File 'lib/prct06/menuFood.rb', line 26

def initialize(food, ttl, dip, vct, pprtn, pfts, pchdt)

	@food = food

	super(ttl, dip, vct, pprtn, pfts, pchdt)

end

Instance Attribute Details

#MObject



19
20
21
# File 'lib/prct06/menuFood.rb', line 19

def food
  @food
end

Instance Method Details

#to_sString

Returns String con el contenido de la lista

Returns:

  • (String)

    String con el contenido de la lista



37
38
39
40
41
42
# File 'lib/prct06/menuFood.rb', line 37

def to_s()

	tmp = super.to_s + "Alimentos: #{@food}\n"
               tmp

end