{"action":"created","comment":{"url":"https://api.github.com/repos/makersacademy/takeaway-challenge/pulls/comments/51396780","id":51396780,"diff_hunk":"@@ -0,0 +1,43 @@\n+require './lib/menu.rb'\n+require './lib/sms_sender.rb'\n+class Takeaway\n+\n+attr_reader :customer_order\n+\n+ def view_menu\n+  Menu.new.menu\n+ end\n+\n+ def place_order(order_hash, exact_total)\n+  @customer_order = order_hash\n+  order_checker\n+  message = 'sorry your calculated sum does not match the order total'\n+  raise(message) if order_sum != exact_total\n+  sms_send\n+ end\n+\n+ def order_sum\n+  cost = view_menu.map {|k, v| v * @customer_order[k] if @customer_order.key? k}.compact\n+  cost.inject(:+)\n+ end\n+\n+\n+private\n+\n+def order_checker\n+  message = \"sorry you have ordered something that doesn't exist\"\n+  message2 = \" on the menu, please check your order and try again\"\n+  if (@customer_order.keys - view_menu.keys).empty? != true\n+    raise \"#{message}#{message2}\"\n+  end\n+\n+def sms_send","path":"lib/takeaway.rb","position":34,"original_position":34,"commit_id":"b3786ebd63bc8de811de7d5f186c8a4178d28f87","original_commit_id":"b3786ebd63bc8de811de7d5f186c8a4178d28f87","user":{"login":"houndci","id":6697940,"avatar_url":"https://avatars.githubusercontent.com/u/6697940?v=3","gravatar_id":"","url":"https://api.github.com/users/houndci","html_url":"https://github.com/houndci","followers_url":"https://api.github.com/users/houndci/followers","following_url":"https://api.github.com/users/houndci/following{/other_user}","gists_url":"https://api.github.com/users/houndci/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci/subscriptions","organizations_url":"https://api.github.com/users/houndci/orgs","repos_url":"https://api.github.com/users/houndci/repos","events_url":"https://api.github.com/users/houndci/events{/privacy}","received_events_url":"https://api.github.com/users/houndci/received_events","type":"User","site_admin":false},"body":"Lint/NestedMethodDefinition: Method definitions must not be nested. Use `lambda` instead. (https://github.com/bbatsov/ruby-style-guide#no-nested-methods)","created_at":"2016-02-01T09:45:23Z","updated_at":"2016-02-01T09:45:23Z","html_url":"https://github.com/makersacademy/takeaway-challenge/pull/298#discussion_r51396780","pull_request_url":"https://api.github.com/repos/makersacademy/takeaway-challenge/pulls/298","_links":{"self":{"href":"https://api.github.com/repos/makersacademy/takeaway-challenge/pulls/comments/51396780"},"html":{"href":"https://github.com/makersacademy/takeaway-challenge/pull/298#discussion_r51396780"},"pull_request":{"href":"https://api.github.com/repos/makersacademy/takeaway-challenge/pulls/298"}}},"pull_request":{"url":"https://api.github.com/repos/makersacademy/takeaway-challenge/pulls/298","id":57816163,"html_url":"https://github.com/makersacademy/takeaway-challenge/pull/298","diff_url":"https://github.com/makersacademy/takeaway-challenge/pull/298.diff","patch_url":"https://github.com/makersacademy/takeaway-challenge/pull/298.patch","issue_url":"https://api.github.com/repos/makersacademy/takeaway-challenge/issues/298","number":298,"state":"open","locked":false,"title":"Takeaway Challenge - Needs Refactoring :S","user":{"login":"reissjohnson","id":13954936,"avatar_url":"https://avatars.githubusercontent.com/u/13954936?v=3","gravatar_id":"","url":"https://api.github.com/users/reissjohnson","html_url":"https://github.com/reissjohnson","followers_url":"https://api.github.com/users/reissjohnson/followers","following_url":"https://api.github.com/users/reissjohnson/following{/other_user}","gists_url":"https://api.github.com/users/reissjohnson/gists{/gist_id}","starred_url":"https://api.github.com/users/reissjohnson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/reissjohnson/subscriptions","organizations_url":"https://api.github.com/users/reissjohnson/orgs","repos_url":"https://api.github.com/users/reissjohnson/repos","events_url":"https://api.github.com/users/reissjohnson/events{/privacy}","received_events_url":"https://api.github.com/users/reissjohnson/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-02-01T09:45:15Z","updated_at":"2016-02-01T09:45:23Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d9bba9af6f706dfcc2bfa55af96a38e0ef4b946a","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/makersacademy/takeaway-challenge/pulls/298/commits","review_comments_url":"https://api.github.com/repos/makersacademy/takeaway-challenge/pulls/298/comments","review_comment_url":"https://api.github.com/repos/makersacademy/takeaway-challenge/pulls/comments{/number}","comments_url":"https://api.github.com/repos/makersacademy/takeaway-challenge/issues/298/comments","statuses_url":"https://api.github.com/repos/makersacademy/takeaway-challenge/statuses/b3786ebd63bc8de811de7d5f186c8a4178d28f87","head":{"label":"reissjohnson:master","ref":"master","sha":"b3786ebd63bc8de811de7d5f186c8a4178d28f87","user":{"login":"reissjohnson","id":13954936,"avatar_url":"https://avatars.githubusercontent.com/u/13954936?v=3","gravatar_id":"","url":"https://api.github.com/users/reissjohnson","html_url":"https://github.com/reissjohnson","followers_url":"https://api.github.com/users/reissjohnson/followers","following_url":"https://api.github.com/users/reissjohnson/following{/other_user}","gists_url":"https://api.github.com/users/reissjohnson/gists{/gist_id}","starred_url":"https://api.github.com/users/reissjohnson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/reissjohnson/subscriptions","organizations_url":"https://api.github.com/users/reissjohnson/orgs","repos_url":"https://api.github.com/users/reissjohnson/repos","events_url":"https://api.github.com/users/reissjohnson/events{/privacy}","received_events_url":"https://api.github.com/users/reissjohnson/received_events","type":"User","site_admin":false},"repo":{"id":50744349,"name":"takeaway-challenge","full_name":"reissjohnson/takeaway-challenge","owner":{"login":"reissjohnson","id":13954936,"avatar_url":"https://avatars.githubusercontent.com/u/13954936?v=3","gravatar_id":"","url":"https://api.github.com/users/reissjohnson","html_url":"https://github.com/reissjohnson","followers_url":"https://api.github.com/users/reissjohnson/followers","following_url":"https://api.github.com/users/reissjohnson/following{/other_user}","gists_url":"https://api.github.com/users/reissjohnson/gists{/gist_id}","starred_url":"https://api.github.com/users/reissjohnson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/reissjohnson/subscriptions","organizations_url":"https://api.github.com/users/reissjohnson/orgs","repos_url":"https://api.github.com/users/reissjohnson/repos","events_url":"https://api.github.com/users/reissjohnson/events{/privacy}","received_events_url":"https://api.github.com/users/reissjohnson/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/reissjohnson/takeaway-challenge","description":"Use the Twilio Gem to order food","fork":true,"url":"https://api.github.com/repos/reissjohnson/takeaway-challenge","forks_url":"https://api.github.com/repos/reissjohnson/takeaway-challenge/forks","keys_url":"https://api.github.com/repos/reissjohnson/takeaway-challenge/keys{/key_id}","collaborators_url":"https://api.github.com/repos/reissjohnson/takeaway-challenge/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/reissjohnson/takeaway-challenge/teams","hooks_url":"https://api.github.com/repos/reissjohnson/takeaway-challenge/hooks","issue_events_url":"https://api.github.com/repos/reissjohnson/takeaway-challenge/issues/events{/number}","events_url":"https://api.github.com/repos/reissjohnson/takeaway-challenge/events","assignees_url":"https://api.github.com/repos/reissjohnson/takeaway-challenge/assignees{/user}","branches_url":"https://api.github.com/repos/reissjohnson/takeaway-challenge/branches{/branch}","tags_url":"https://api.github.com/repos/reissjohnson/takeaway-challenge/tags","blobs_url":"https://api.github.com/repos/reissjohnson/takeaway-challenge/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/reissjohnson/takeaway-challenge/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/reissjohnson/takeaway-challenge/git/refs{/sha}","trees_url":"https://api.github.com/repos/reissjohnson/takeaway-challenge/git/trees{/sha}","statuses_url":"https://api.github.com/repos/reissjohnson/takeaway-challenge/statuses/{sha}","languages_url":"https://api.github.com/repos/reissjohnson/takeaway-challenge/languages","stargazers_url":"https://api.github.com/repos/reissjohnson/takeaway-challenge/stargazers","contributors_url":"https://api.github.com/repos/reissjohnson/takeaway-challenge/contributors","subscribers_url":"https://api.github.com/repos/reissjohnson/takeaway-challenge/subscribers","subscription_url":"https://api.github.com/repos/reissjohnson/takeaway-challenge/subscription","commits_url":"https://api.github.com/repos/reissjohnson/takeaway-challenge/commits{/sha}","git_commits_url":"https://api.github.com/repos/reissjohnson/takeaway-challenge/git/commits{/sha}","comments_url":"https://api.github.com/repos/reissjohnson/takeaway-challenge/comments{/number}","issue_comment_url":"https://api.github.com/repos/reissjohnson/takeaway-challenge/issues/comments{/number}","contents_url":"https://api.github.com/repos/reissjohnson/takeaway-challenge/contents/{+path}","compare_url":"https://api.github.com/repos/reissjohnson/takeaway-challenge/compare/{base}...{head}","merges_url":"https://api.github.com/repos/reissjohnson/takeaway-challenge/merges","archive_url":"https://api.github.com/repos/reissjohnson/takeaway-challenge/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/reissjohnson/takeaway-challenge/downloads","issues_url":"https://api.github.com/repos/reissjohnson/takeaway-challenge/issues{/number}","pulls_url":"https://api.github.com/repos/reissjohnson/takeaway-challenge/pulls{/number}","milestones_url":"https://api.github.com/repos/reissjohnson/takeaway-challenge/milestones{/number}","notifications_url":"https://api.github.com/repos/reissjohnson/takeaway-challenge/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/reissjohnson/takeaway-challenge/labels{/name}","releases_url":"https://api.github.com/repos/reissjohnson/takeaway-challenge/releases{/id}","deployments_url":"https://api.github.com/repos/reissjohnson/takeaway-challenge/deployments","created_at":"2016-01-30T20:49:27Z","updated_at":"2016-01-30T20:49:28Z","pushed_at":"2016-01-31T21:36:41Z","git_url":"git://github.com/reissjohnson/takeaway-challenge.git","ssh_url":"git@github.com:reissjohnson/takeaway-challenge.git","clone_url":"https://github.com/reissjohnson/takeaway-challenge.git","svn_url":"https://github.com/reissjohnson/takeaway-challenge","homepage":null,"size":55,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"makersacademy:master","ref":"master","sha":"646084412ff25d904f34e4af8d96b897247e548a","user":{"login":"makersacademy","id":3636186,"avatar_url":"https://avatars.githubusercontent.com/u/3636186?v=3","gravatar_id":"","url":"https://api.github.com/users/makersacademy","html_url":"https://github.com/makersacademy","followers_url":"https://api.github.com/users/makersacademy/followers","following_url":"https://api.github.com/users/makersacademy/following{/other_user}","gists_url":"https://api.github.com/users/makersacademy/gists{/gist_id}","starred_url":"https://api.github.com/users/makersacademy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/makersacademy/subscriptions","organizations_url":"https://api.github.com/users/makersacademy/orgs","repos_url":"https://api.github.com/users/makersacademy/repos","events_url":"https://api.github.com/users/makersacademy/events{/privacy}","received_events_url":"https://api.github.com/users/makersacademy/received_events","type":"Organization","site_admin":false},"repo":{"id":27006189,"name":"takeaway-challenge","full_name":"makersacademy/takeaway-challenge","owner":{"login":"makersacademy","id":3636186,"avatar_url":"https://avatars.githubusercontent.com/u/3636186?v=3","gravatar_id":"","url":"https://api.github.com/users/makersacademy","html_url":"https://github.com/makersacademy","followers_url":"https://api.github.com/users/makersacademy/followers","following_url":"https://api.github.com/users/makersacademy/following{/other_user}","gists_url":"https://api.github.com/users/makersacademy/gists{/gist_id}","starred_url":"https://api.github.com/users/makersacademy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/makersacademy/subscriptions","organizations_url":"https://api.github.com/users/makersacademy/orgs","repos_url":"https://api.github.com/users/makersacademy/repos","events_url":"https://api.github.com/users/makersacademy/events{/privacy}","received_events_url":"https://api.github.com/users/makersacademy/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/makersacademy/takeaway-challenge","description":"Use the Twilio Gem to order food","fork":false,"url":"https://api.github.com/repos/makersacademy/takeaway-challenge","forks_url":"https://api.github.com/repos/makersacademy/takeaway-challenge/forks","keys_url":"https://api.github.com/repos/makersacademy/takeaway-challenge/keys{/key_id}","collaborators_url":"https://api.github.com/repos/makersacademy/takeaway-challenge/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/makersacademy/takeaway-challenge/teams","hooks_url":"https://api.github.com/repos/makersacademy/takeaway-challenge/hooks","issue_events_url":"https://api.github.com/repos/makersacademy/takeaway-challenge/issues/events{/number}","events_url":"https://api.github.com/repos/makersacademy/takeaway-challenge/events","assignees_url":"https://api.github.com/repos/makersacademy/takeaway-challenge/assignees{/user}","branches_url":"https://api.github.com/repos/makersacademy/takeaway-challenge/branches{/branch}","tags_url":"https://api.github.com/repos/makersacademy/takeaway-challenge/tags","blobs_url":"https://api.github.com/repos/makersacademy/takeaway-challenge/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/makersacademy/takeaway-challenge/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/makersacademy/takeaway-challenge/git/refs{/sha}","trees_url":"https://api.github.com/repos/makersacademy/takeaway-challenge/git/trees{/sha}","statuses_url":"https://api.github.com/repos/makersacademy/takeaway-challenge/statuses/{sha}","languages_url":"https://api.github.com/repos/makersacademy/takeaway-challenge/languages","stargazers_url":"https://api.github.com/repos/makersacademy/takeaway-challenge/stargazers","contributors_url":"https://api.github.com/repos/makersacademy/takeaway-challenge/contributors","subscribers_url":"https://api.github.com/repos/makersacademy/takeaway-challenge/subscribers","subscription_url":"https://api.github.com/repos/makersacademy/takeaway-challenge/subscription","commits_url":"https://api.github.com/repos/makersacademy/takeaway-challenge/commits{/sha}","git_commits_url":"https://api.github.com/repos/makersacademy/takeaway-challenge/git/commits{/sha}","comments_url":"https://api.github.com/repos/makersacademy/takeaway-challenge/comments{/number}","issue_comment_url":"https://api.github.com/repos/makersacademy/takeaway-challenge/issues/comments{/number}","contents_url":"https://api.github.com/repos/makersacademy/takeaway-challenge/contents/{+path}","compare_url":"https://api.github.com/repos/makersacademy/takeaway-challenge/compare/{base}...{head}","merges_url":"https://api.github.com/repos/makersacademy/takeaway-challenge/merges","archive_url":"https://api.github.com/repos/makersacademy/takeaway-challenge/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/makersacademy/takeaway-challenge/downloads","issues_url":"https://api.github.com/repos/makersacademy/takeaway-challenge/issues{/number}","pulls_url":"https://api.github.com/repos/makersacademy/takeaway-challenge/pulls{/number}","milestones_url":"https://api.github.com/repos/makersacademy/takeaway-challenge/milestones{/number}","notifications_url":"https://api.github.com/repos/makersacademy/takeaway-challenge/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/makersacademy/takeaway-challenge/labels{/name}","releases_url":"https://api.github.com/repos/makersacademy/takeaway-challenge/releases{/id}","deployments_url":"https://api.github.com/repos/makersacademy/takeaway-challenge/deployments","created_at":"2014-11-22T17:19:46Z","updated_at":"2015-08-03T10:38:46Z","pushed_at":"2016-02-01T09:45:16Z","git_url":"git://github.com/makersacademy/takeaway-challenge.git","ssh_url":"git@github.com:makersacademy/takeaway-challenge.git","clone_url":"https://github.com/makersacademy/takeaway-challenge.git","svn_url":"https://github.com/makersacademy/takeaway-challenge","homepage":null,"size":2451,"stargazers_count":1,"watchers_count":1,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":259,"mirror_url":null,"open_issues_count":49,"forks":259,"open_issues":49,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/makersacademy/takeaway-challenge/pulls/298"},"html":{"href":"https://github.com/makersacademy/takeaway-challenge/pull/298"},"issue":{"href":"https://api.github.com/repos/makersacademy/takeaway-challenge/issues/298"},"comments":{"href":"https://api.github.com/repos/makersacademy/takeaway-challenge/issues/298/comments"},"review_comments":{"href":"https://api.github.com/repos/makersacademy/takeaway-challenge/pulls/298/comments"},"review_comment":{"href":"https://api.github.com/repos/makersacademy/takeaway-challenge/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/makersacademy/takeaway-challenge/pulls/298/commits"},"statuses":{"href":"https://api.github.com/repos/makersacademy/takeaway-challenge/statuses/b3786ebd63bc8de811de7d5f186c8a4178d28f87"}}}}