Class: Dieta::Edad

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) ⇒ Edad

Returns a new instance of Edad



125
126
127
# File 'lib/practica8/dieta.rb', line 125

def initialize(a,b,c,d)
    @cabecera, @descrip, @vct, @rango_edad = a, b, c, d
end

Instance Attribute Details

#rango_edadObject

Returns the value of attribute rango_edad



123
124
125
# File 'lib/practica8/dieta.rb', line 123

def rango_edad
  @rango_edad
end

Instance Method Details

#rangoObject



129
130
131
132
# File 'lib/practica8/dieta.rb', line 129

def rango()
    out = "\nIntervalos de edad: #{@rango_edad}"
    out
end

#to_sObject



134
135
136
137
138
# File 'lib/practica8/dieta.rb', line 134

def to_s
    out = super.to_s
    out << rango()
    out
end