Advertisement
Guest User

Untitled

a guest
Jul 20th, 2017
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.67 KB | None | 0 0
  1.   def initialize_commands service, stream, mapping
  2.     command_list = [CreateNewFoodCommand, CreateNewRecipeCommand,
  3.       PrintFoodCommand, PrintAllCommand, FindFoodCommand,
  4.       AddItemToLogCommand, ShowLogSummaryCommand,
  5.       ShowLogSummaryTodayCommand, AddItemToLogWithDateCommand,
  6.       ShowLogSummaryWithDateCommand, DeleteItemFromLogCommand,
  7.       DeleteItemFromLogWithDateCommand, SaveCommand
  8.     ]
  9.  
  10.     command_list.each do |command|
  11.       mapping = command.new(service, stream).populate(mapping)
  12.     end
  13.  
  14.     return mapping
  15.   end
  16.  
  17.  
  18. -----------------------------------------
  19.  
  20.   def populate mapping
  21.     mapping[@expression] = self
  22.     return mapping
  23.   end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement