Class: Dieta::Alimento
Instance Attribute Summary collapse
-
#saludable ⇒ Object
Returns the value of attribute saludable.
Attributes inherited from Dieta
Instance Method Summary collapse
-
#initialize(a, b, c, d) ⇒ Alimento
constructor
A new instance of Alimento.
- #salud ⇒ Object
- #to_s ⇒ Object
Methods inherited from Dieta
#<=>, #get_footer, #get_plato, #get_platos, #get_porc_gras, #get_porc_hdc, #get_porc_inges_diaria, #get_porc_prot, #get_titulo, #get_vct
Constructor Details
#initialize(a, b, c, d) ⇒ Alimento
Returns a new instance of Alimento
106 107 108 |
# File 'lib/practica8/dieta.rb', line 106 def initialize(a,b,c,d) @cabecera, @descrip, @vct, @saludable = a, b, c, d end |
Instance Attribute Details
#saludable ⇒ Object
Returns the value of attribute saludable
104 105 106 |
# File 'lib/practica8/dieta.rb', line 104 def saludable @saludable end |
Instance Method Details
#salud ⇒ Object
110 111 112 113 |
# File 'lib/practica8/dieta.rb', line 110 def salud() out = "\nGrupo de alimentos: #{@saludable}" out end |
#to_s ⇒ Object
115 116 117 118 119 |
# File 'lib/practica8/dieta.rb', line 115 def to_s out = super.to_s out << salud() out end |