Class: MenuAge

Inherits:
Diet
  • Object
show all
Defined in:
lib/prct06/menuAge.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(age, ttl, dip, vct, pprtn, pfts, pchdt) ⇒ MenuAge

Returns a new instance of MenuAge

Parameters:

  • Rango (String)

    de edad, [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



23
24
25
26
27
28
29
# File 'lib/prct06/menuAge.rb', line 23

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

			@age = age

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

end

Instance Attribute Details

#MObject



16
17
18
# File 'lib/prct06/menuAge.rb', line 16

def age
  @age
end

Instance Method Details

#to_sString

Returns String con el contenido de la lista

Returns:

  • (String)

    String con el contenido de la lista



34
35
36
37
38
39
40
# File 'lib/prct06/menuAge.rb', line 34

def to_s()
			
tmp = super.to_s + "Edad: #{@age}\n"
		
tmp
		
end