Skip to content

Instantly share code, notes, and snippets.

@ashleygwilliams
Last active December 18, 2015 16:19
Show Gist options
  • Save ashleygwilliams/5811063 to your computer and use it in GitHub Desktop.
Save ashleygwilliams/5811063 to your computer and use it in GitHub Desktop.
homework for alex
#fill out this meal array with items and details hashes. make sure you have at least 5 items
ITEMS = [ "ITEM" => {:calories=> ??, :fat => ??, :carbs => ??, :protein=>},
"ITEM" => {:calories=> ??, :fat => ??, :carbs => ??, :protein=>}
]
#here is a method that randomly makes you eat x portions of the food
def generatePortions
portions = []
rand(20).times do
portions.push(ITEMS.sample)
end
portions
end
#create a hash that counts the portions and adds them to a new hash
#then create methods that count the calories, fat, carbs, and protein in the meal
#print a meal summary to the screen
read http://www.w3schools.com/sql/ << teach you how to build sql tables
port the scraper lib from the sinatra app to the rails app
pay attention to what your models are!!
tables = > columns :: models => attributes
what data am i scraping || what attributes does my model have || what columns should my table have
SCRAPER || RAILS || SQL
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment