{"action":"created","comment":{"url":"https://api.github.com/repos/antonefremov/ror-basics-course/pulls/comments/75600712","id":75600712,"diff_hunk":"@@ -0,0 +1,42 @@\n+#program start\n+shopping_cart = {}\n+items = {}\n+sum = 0.0\n+overall_sum = 0.0\n+\n+#get user's input\n+loop do\n+  puts \"\"\n+  print \"Please enter the good's name: \"\n+  good = gets.chomp.downcase\n+  break if good == \"stop\"\n+\n+  print \"Please enter the good's price: \"\n+  price = gets.chomp.to_f\n+\n+  print \"Please enter the number of items you would like to get: \"\n+  count = gets.chomp.to_f\n+\n+  sum = price * count\n+\n+  if sum <= 0\n+    puts \"I can't add negative amount to the cart\"\n+  else\n+    items = {}\n+    items.store(\"price\", price)\n+    items.store(\"count\", count)\n+    items.store(\"sum\", sum.round(2))\n+    shopping_cart.store(\"#{good}\", items)","path":"Lesson_2-comments/6_Shopping_cart.rb","position":29,"original_position":29,"commit_id":"0ebd4d6c342970c2bfd49ff5a66d783f8c5fb624","original_commit_id":"0ebd4d6c342970c2bfd49ff5a66d783f8c5fb624","user":{"login":"antonefremov","id":13541424,"avatar_url":"https://avatars.githubusercontent.com/u/13541424?v=3","gravatar_id":"","url":"https://api.github.com/users/antonefremov","html_url":"https://github.com/antonefremov","followers_url":"https://api.github.com/users/antonefremov/followers","following_url":"https://api.github.com/users/antonefremov/following{/other_user}","gists_url":"https://api.github.com/users/antonefremov/gists{/gist_id}","starred_url":"https://api.github.com/users/antonefremov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/antonefremov/subscriptions","organizations_url":"https://api.github.com/users/antonefremov/orgs","repos_url":"https://api.github.com/users/antonefremov/repos","events_url":"https://api.github.com/users/antonefremov/events{/privacy}","received_events_url":"https://api.github.com/users/antonefremov/received_events","type":"User","site_admin":false},"body":"Я поменял код в сторону добавления медведей к уже существующим и переприсвоения старой цены на новую. Конечно, это тренировочная задача. В реальной жизни этот сценарий можно сильно усложнить.","created_at":"2016-08-21T18:24:26Z","updated_at":"2016-08-21T18:24:26Z","html_url":"https://github.com/antonefremov/ror-basics-course/pull/2#discussion_r75600712","pull_request_url":"https://api.github.com/repos/antonefremov/ror-basics-course/pulls/2","_links":{"self":{"href":"https://api.github.com/repos/antonefremov/ror-basics-course/pulls/comments/75600712"},"html":{"href":"https://github.com/antonefremov/ror-basics-course/pull/2#discussion_r75600712"},"pull_request":{"href":"https://api.github.com/repos/antonefremov/ror-basics-course/pulls/2"}}},"pull_request":{"url":"https://api.github.com/repos/antonefremov/ror-basics-course/pulls/2","id":82078859,"html_url":"https://github.com/antonefremov/ror-basics-course/pull/2","diff_url":"https://github.com/antonefremov/ror-basics-course/pull/2.diff","patch_url":"https://github.com/antonefremov/ror-basics-course/pull/2.patch","issue_url":"https://api.github.com/repos/antonefremov/ror-basics-course/issues/2","number":2,"state":"open","locked":false,"title":"Add lesson 2 comments","user":{"login":"psylone","id":224141,"avatar_url":"https://avatars.githubusercontent.com/u/224141?v=3","gravatar_id":"","url":"https://api.github.com/users/psylone","html_url":"https://github.com/psylone","followers_url":"https://api.github.com/users/psylone/followers","following_url":"https://api.github.com/users/psylone/following{/other_user}","gists_url":"https://api.github.com/users/psylone/gists{/gist_id}","starred_url":"https://api.github.com/users/psylone/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/psylone/subscriptions","organizations_url":"https://api.github.com/users/psylone/orgs","repos_url":"https://api.github.com/users/psylone/repos","events_url":"https://api.github.com/users/psylone/events{/privacy}","received_events_url":"https://api.github.com/users/psylone/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-08-20T13:34:26Z","updated_at":"2016-08-21T18:24:26Z","closed_at":null,"merged_at":null,"merge_commit_sha":"68f93c883085daf40596de342596a9ea6dd5d2e0","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/antonefremov/ror-basics-course/pulls/2/commits","review_comments_url":"https://api.github.com/repos/antonefremov/ror-basics-course/pulls/2/comments","review_comment_url":"https://api.github.com/repos/antonefremov/ror-basics-course/pulls/comments{/number}","comments_url":"https://api.github.com/repos/antonefremov/ror-basics-course/issues/2/comments","statuses_url":"https://api.github.com/repos/antonefremov/ror-basics-course/statuses/0ebd4d6c342970c2bfd49ff5a66d783f8c5fb624","head":{"label":"psylone:master","ref":"master","sha":"0ebd4d6c342970c2bfd49ff5a66d783f8c5fb624","user":{"login":"psylone","id":224141,"avatar_url":"https://avatars.githubusercontent.com/u/224141?v=3","gravatar_id":"","url":"https://api.github.com/users/psylone","html_url":"https://github.com/psylone","followers_url":"https://api.github.com/users/psylone/followers","following_url":"https://api.github.com/users/psylone/following{/other_user}","gists_url":"https://api.github.com/users/psylone/gists{/gist_id}","starred_url":"https://api.github.com/users/psylone/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/psylone/subscriptions","organizations_url":"https://api.github.com/users/psylone/orgs","repos_url":"https://api.github.com/users/psylone/repos","events_url":"https://api.github.com/users/psylone/events{/privacy}","received_events_url":"https://api.github.com/users/psylone/received_events","type":"User","site_admin":false},"repo":{"id":66148358,"name":"ror-basics-course","full_name":"psylone/ror-basics-course","owner":{"login":"psylone","id":224141,"avatar_url":"https://avatars.githubusercontent.com/u/224141?v=3","gravatar_id":"","url":"https://api.github.com/users/psylone","html_url":"https://github.com/psylone","followers_url":"https://api.github.com/users/psylone/followers","following_url":"https://api.github.com/users/psylone/following{/other_user}","gists_url":"https://api.github.com/users/psylone/gists{/gist_id}","starred_url":"https://api.github.com/users/psylone/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/psylone/subscriptions","organizations_url":"https://api.github.com/users/psylone/orgs","repos_url":"https://api.github.com/users/psylone/repos","events_url":"https://api.github.com/users/psylone/events{/privacy}","received_events_url":"https://api.github.com/users/psylone/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/psylone/ror-basics-course","description":"RoR Basics course repository","fork":true,"url":"https://api.github.com/repos/psylone/ror-basics-course","forks_url":"https://api.github.com/repos/psylone/ror-basics-course/forks","keys_url":"https://api.github.com/repos/psylone/ror-basics-course/keys{/key_id}","collaborators_url":"https://api.github.com/repos/psylone/ror-basics-course/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/psylone/ror-basics-course/teams","hooks_url":"https://api.github.com/repos/psylone/ror-basics-course/hooks","issue_events_url":"https://api.github.com/repos/psylone/ror-basics-course/issues/events{/number}","events_url":"https://api.github.com/repos/psylone/ror-basics-course/events","assignees_url":"https://api.github.com/repos/psylone/ror-basics-course/assignees{/user}","branches_url":"https://api.github.com/repos/psylone/ror-basics-course/branches{/branch}","tags_url":"https://api.github.com/repos/psylone/ror-basics-course/tags","blobs_url":"https://api.github.com/repos/psylone/ror-basics-course/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/psylone/ror-basics-course/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/psylone/ror-basics-course/git/refs{/sha}","trees_url":"https://api.github.com/repos/psylone/ror-basics-course/git/trees{/sha}","statuses_url":"https://api.github.com/repos/psylone/ror-basics-course/statuses/{sha}","languages_url":"https://api.github.com/repos/psylone/ror-basics-course/languages","stargazers_url":"https://api.github.com/repos/psylone/ror-basics-course/stargazers","contributors_url":"https://api.github.com/repos/psylone/ror-basics-course/contributors","subscribers_url":"https://api.github.com/repos/psylone/ror-basics-course/subscribers","subscription_url":"https://api.github.com/repos/psylone/ror-basics-course/subscription","commits_url":"https://api.github.com/repos/psylone/ror-basics-course/commits{/sha}","git_commits_url":"https://api.github.com/repos/psylone/ror-basics-course/git/commits{/sha}","comments_url":"https://api.github.com/repos/psylone/ror-basics-course/comments{/number}","issue_comment_url":"https://api.github.com/repos/psylone/ror-basics-course/issues/comments{/number}","contents_url":"https://api.github.com/repos/psylone/ror-basics-course/contents/{+path}","compare_url":"https://api.github.com/repos/psylone/ror-basics-course/compare/{base}...{head}","merges_url":"https://api.github.com/repos/psylone/ror-basics-course/merges","archive_url":"https://api.github.com/repos/psylone/ror-basics-course/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/psylone/ror-basics-course/downloads","issues_url":"https://api.github.com/repos/psylone/ror-basics-course/issues{/number}","pulls_url":"https://api.github.com/repos/psylone/ror-basics-course/pulls{/number}","milestones_url":"https://api.github.com/repos/psylone/ror-basics-course/milestones{/number}","notifications_url":"https://api.github.com/repos/psylone/ror-basics-course/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/psylone/ror-basics-course/labels{/name}","releases_url":"https://api.github.com/repos/psylone/ror-basics-course/releases{/id}","deployments_url":"https://api.github.com/repos/psylone/ror-basics-course/deployments","created_at":"2016-08-20T13:32:56Z","updated_at":"2016-08-20T13:32:57Z","pushed_at":"2016-08-20T13:34:13Z","git_url":"git://github.com/psylone/ror-basics-course.git","ssh_url":"git@github.com:psylone/ror-basics-course.git","clone_url":"https://github.com/psylone/ror-basics-course.git","svn_url":"https://github.com/psylone/ror-basics-course","homepage":null,"size":12,"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":"antonefremov:master","ref":"master","sha":"10144d8c51fd2c713f343a1c053a05322574f238","user":{"login":"antonefremov","id":13541424,"avatar_url":"https://avatars.githubusercontent.com/u/13541424?v=3","gravatar_id":"","url":"https://api.github.com/users/antonefremov","html_url":"https://github.com/antonefremov","followers_url":"https://api.github.com/users/antonefremov/followers","following_url":"https://api.github.com/users/antonefremov/following{/other_user}","gists_url":"https://api.github.com/users/antonefremov/gists{/gist_id}","starred_url":"https://api.github.com/users/antonefremov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/antonefremov/subscriptions","organizations_url":"https://api.github.com/users/antonefremov/orgs","repos_url":"https://api.github.com/users/antonefremov/repos","events_url":"https://api.github.com/users/antonefremov/events{/privacy}","received_events_url":"https://api.github.com/users/antonefremov/received_events","type":"User","site_admin":false},"repo":{"id":65154413,"name":"ror-basics-course","full_name":"antonefremov/ror-basics-course","owner":{"login":"antonefremov","id":13541424,"avatar_url":"https://avatars.githubusercontent.com/u/13541424?v=3","gravatar_id":"","url":"https://api.github.com/users/antonefremov","html_url":"https://github.com/antonefremov","followers_url":"https://api.github.com/users/antonefremov/followers","following_url":"https://api.github.com/users/antonefremov/following{/other_user}","gists_url":"https://api.github.com/users/antonefremov/gists{/gist_id}","starred_url":"https://api.github.com/users/antonefremov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/antonefremov/subscriptions","organizations_url":"https://api.github.com/users/antonefremov/orgs","repos_url":"https://api.github.com/users/antonefremov/repos","events_url":"https://api.github.com/users/antonefremov/events{/privacy}","received_events_url":"https://api.github.com/users/antonefremov/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/antonefremov/ror-basics-course","description":"RoR Basics course repository","fork":false,"url":"https://api.github.com/repos/antonefremov/ror-basics-course","forks_url":"https://api.github.com/repos/antonefremov/ror-basics-course/forks","keys_url":"https://api.github.com/repos/antonefremov/ror-basics-course/keys{/key_id}","collaborators_url":"https://api.github.com/repos/antonefremov/ror-basics-course/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/antonefremov/ror-basics-course/teams","hooks_url":"https://api.github.com/repos/antonefremov/ror-basics-course/hooks","issue_events_url":"https://api.github.com/repos/antonefremov/ror-basics-course/issues/events{/number}","events_url":"https://api.github.com/repos/antonefremov/ror-basics-course/events","assignees_url":"https://api.github.com/repos/antonefremov/ror-basics-course/assignees{/user}","branches_url":"https://api.github.com/repos/antonefremov/ror-basics-course/branches{/branch}","tags_url":"https://api.github.com/repos/antonefremov/ror-basics-course/tags","blobs_url":"https://api.github.com/repos/antonefremov/ror-basics-course/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/antonefremov/ror-basics-course/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/antonefremov/ror-basics-course/git/refs{/sha}","trees_url":"https://api.github.com/repos/antonefremov/ror-basics-course/git/trees{/sha}","statuses_url":"https://api.github.com/repos/antonefremov/ror-basics-course/statuses/{sha}","languages_url":"https://api.github.com/repos/antonefremov/ror-basics-course/languages","stargazers_url":"https://api.github.com/repos/antonefremov/ror-basics-course/stargazers","contributors_url":"https://api.github.com/repos/antonefremov/ror-basics-course/contributors","subscribers_url":"https://api.github.com/repos/antonefremov/ror-basics-course/subscribers","subscription_url":"https://api.github.com/repos/antonefremov/ror-basics-course/subscription","commits_url":"https://api.github.com/repos/antonefremov/ror-basics-course/commits{/sha}","git_commits_url":"https://api.github.com/repos/antonefremov/ror-basics-course/git/commits{/sha}","comments_url":"https://api.github.com/repos/antonefremov/ror-basics-course/comments{/number}","issue_comment_url":"https://api.github.com/repos/antonefremov/ror-basics-course/issues/comments{/number}","contents_url":"https://api.github.com/repos/antonefremov/ror-basics-course/contents/{+path}","compare_url":"https://api.github.com/repos/antonefremov/ror-basics-course/compare/{base}...{head}","merges_url":"https://api.github.com/repos/antonefremov/ror-basics-course/merges","archive_url":"https://api.github.com/repos/antonefremov/ror-basics-course/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/antonefremov/ror-basics-course/downloads","issues_url":"https://api.github.com/repos/antonefremov/ror-basics-course/issues{/number}","pulls_url":"https://api.github.com/repos/antonefremov/ror-basics-course/pulls{/number}","milestones_url":"https://api.github.com/repos/antonefremov/ror-basics-course/milestones{/number}","notifications_url":"https://api.github.com/repos/antonefremov/ror-basics-course/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/antonefremov/ror-basics-course/labels{/name}","releases_url":"https://api.github.com/repos/antonefremov/ror-basics-course/releases{/id}","deployments_url":"https://api.github.com/repos/antonefremov/ror-basics-course/deployments","created_at":"2016-08-07T21:16:05Z","updated_at":"2016-08-15T09:31:47Z","pushed_at":"2016-08-21T18:15:49Z","git_url":"git://github.com/antonefremov/ror-basics-course.git","ssh_url":"git@github.com:antonefremov/ror-basics-course.git","clone_url":"https://github.com/antonefremov/ror-basics-course.git","svn_url":"https://github.com/antonefremov/ror-basics-course","homepage":null,"size":15,"stargazers_count":2,"watchers_count":2,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":2,"forks":1,"open_issues":2,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/antonefremov/ror-basics-course/pulls/2"},"html":{"href":"https://github.com/antonefremov/ror-basics-course/pull/2"},"issue":{"href":"https://api.github.com/repos/antonefremov/ror-basics-course/issues/2"},"comments":{"href":"https://api.github.com/repos/antonefremov/ror-basics-course/issues/2/comments"},"review_comments":{"href":"https://api.github.com/repos/antonefremov/ror-basics-course/pulls/2/comments"},"review_comment":{"href":"https://api.github.com/repos/antonefremov/ror-basics-course/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/antonefremov/ror-basics-course/pulls/2/commits"},"statuses":{"href":"https://api.github.com/repos/antonefremov/ror-basics-course/statuses/0ebd4d6c342970c2bfd49ff5a66d783f8c5fb624"}}}}
{"actor":{"display_login":"antonefremov"}}