class Menu

Public Instance Methods

<=>(other) click to toggle source
# File lib/NutrientesEdu/Menu.rb, line 18
def <=>(other)
    kcal <=> other.kcal
end
is_enough(persona) click to toggle source
# File lib/NutrientesEdu/Menu.rb, line 12
def is_enough(persona)
    x = kcal
    return (persona.g_en_total <= x * 1.1) && (persona.g_en_total >= x * 0.9)
end
kcal() click to toggle source
# File lib/NutrientesEdu/Menu.rb, line 6
def kcal
    x = collect{|a| a.val_ener}
    y = x.inject(0, :+)
    y
end