Class: MenuFoodGroups

Inherits:
Menu
  • Object
show all
Defined in:
lib/menuFoodGroups.rb

Instance Attribute Summary collapse

Attributes inherited from Menu

#cal, #cvt, #menu, #percentage, #title

Instance Method Summary collapse

Methods inherited from Menu

#<=>, #footer_to_s, #head, #menu_to_s, #nutritionfact, #plate, #title_to_s

Constructor Details

#initialize(a, b, c, d, e, f) ⇒ Menu

Creates a new diet Menu.

Parameters:

  • a

    the menu title

  • b

    the menu percentage

  • c

    the menu calories

  • d

    the menu plates

  • e

    the menu cvt

  • f

    the menu food Group



13
14
15
16
# File 'lib/menuFoodGroups.rb', line 13

def initialize (a,b,c,d,e,f)
  super(a,b,c,d,e)              
  @foodGroup = f
end

Instance Attribute Details

#foodGroupObject (readonly)

Returns the value of attribute foodGroup.



3
4
5
# File 'lib/menuFoodGroups.rb', line 3

def foodGroup
  @foodGroup
end

Instance Method Details

#to_sObject

Returns the menu to string.

Returns:

  • the menu to string.



21
22
23
24
25
26
# File 'lib/menuFoodGroups.rb', line 21

def to_s
  s = " "
  s << super.to_s        
  s << "#{@foodGroup} \n"
  s
end