Class: Dieta::Alimento

Inherits:
Dieta
  • Object
show all
Defined in:
lib/practica8/dieta.rb

Instance Attribute Summary collapse

Attributes inherited from Dieta

#cabecera, #descrip, #vct

Instance Method Summary collapse

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