Class: Grupo_alimento
Overview
Herencia de la clase Alimento
Instance Attribute Summary collapse
-
#grupo ⇒ Object
readonly
Returns the value of attribute grupo.
Attributes inherited from Alimento_
#datos, #fats, #glucids, #name, #proteins
Instance Method Summary collapse
-
#initialize(name, proteins, glucids, fats, group) ⇒ Grupo_alimento
constructor
Se asigna el nombre, las proteinas, los glucidos, las grasas y el grupo del alimento.
-
#to_s ⇒ Object
Formatea la salida a texto.
Methods inherited from Alimento_
#<=>, #aibc, #valor_energetico
Constructor Details
#initialize(name, proteins, glucids, fats, group) ⇒ Grupo_alimento
Se asigna el nombre, las proteinas, los glucidos, las grasas y el grupo del alimento
65 66 67 68 |
# File 'lib/alimento/alimento_.rb', line 65 def initialize(name, proteins, glucids, fats, group) super(name, proteins, glucids, fats) @group = group end |
Instance Attribute Details
#grupo ⇒ Object (readonly)
Returns the value of attribute grupo.
63 64 65 |
# File 'lib/alimento/alimento_.rb', line 63 def grupo @grupo end |
Instance Method Details
#to_s ⇒ Object
Formatea la salida a texto
70 71 72 |
# File 'lib/alimento/alimento_.rb', line 70 def to_s string = super.to_s + "\t#{@group}" end |