{"action":"created","comment":{"url":"https://api.github.com/repos/filip373/ruby_store/pulls/comments/70435656","id":70435656,"diff_hunk":"@@ -0,0 +1,69 @@\n+require 'sinatra/base'\n+require 'sinatra/reloader'\n+require_relative './models/product'\n+require_relative './models/warehouse_product'\n+require_relative './services/store_service'\n+require_relative './services/basket_service'\n+require_relative './services/warehouse_service'\n+require_relative './services/products_service'\n+\n+class App < Sinatra::Base\n+\n+  def initialize(app = nil)\n+    super(app)\n+    products = [\n+      Product.new(name: 'Book', price: 1244, vat: 833),\n+      Product.new(name: 'Chair', price: 4322, vat: 1255),\n+      Product.new(name: 'Ball', price: 522, vat: 950)\n+    ]\n+    @products_service = ProductsService.new(products)\n+    @warehouse_service = WarehouseService.new([\n+      WarehouseProduct.new(product_id: products[0].id, quantity: 3),\n+      WarehouseProduct.new(product_id: products[1].id, quantity: 4),\n+      WarehouseProduct.new(product_id: products[2].id, quantity: 2)\n+    ])\n+    @basket_service = BasketService.new\n+    @store_service = StoreService.new(\n+      basket_service: @basket_service,\n+      warehouse_service: @warehouse_service\n+    )\n+  end\n+\n+  configure :development do\n+    register Sinatra::Reloader\n+  end\n+\n+  get '/' do\n+    erb :index, locals: {title: 'Home'}\n+  end\n+\n+  get '/offer' do\n+    products = @warehouse_service.products.map do |wp|\n+      [@products_service.fetch(wp.product_id), wp.quantity]","path":"lib/app.rb","position":42,"original_position":42,"commit_id":"4bd2b6fd9ce9e23278e8693fb2a793966c556fba","original_commit_id":"4bd2b6fd9ce9e23278e8693fb2a793966c556fba","user":{"login":"gotar","id":135318,"avatar_url":"https://avatars.githubusercontent.com/u/135318?v=3","gravatar_id":"","url":"https://api.github.com/users/gotar","html_url":"https://github.com/gotar","followers_url":"https://api.github.com/users/gotar/followers","following_url":"https://api.github.com/users/gotar/following{/other_user}","gists_url":"https://api.github.com/users/gotar/gists{/gist_id}","starred_url":"https://api.github.com/users/gotar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gotar/subscriptions","organizations_url":"https://api.github.com/users/gotar/orgs","repos_url":"https://api.github.com/users/gotar/repos","events_url":"https://api.github.com/users/gotar/events{/privacy}","received_events_url":"https://api.github.com/users/gotar/received_events","type":"User","site_admin":false},"body":"I do it often too but better will be to use some more descriptive variable name then wp","created_at":"2016-07-12T13:19:34Z","updated_at":"2016-07-12T13:19:34Z","html_url":"https://github.com/filip373/ruby_store/pull/2#discussion_r70435656","pull_request_url":"https://api.github.com/repos/filip373/ruby_store/pulls/2","_links":{"self":{"href":"https://api.github.com/repos/filip373/ruby_store/pulls/comments/70435656"},"html":{"href":"https://github.com/filip373/ruby_store/pull/2#discussion_r70435656"},"pull_request":{"href":"https://api.github.com/repos/filip373/ruby_store/pulls/2"}}},"pull_request":{"url":"https://api.github.com/repos/filip373/ruby_store/pulls/2","id":77116844,"html_url":"https://github.com/filip373/ruby_store/pull/2","diff_url":"https://github.com/filip373/ruby_store/pull/2.diff","patch_url":"https://github.com/filip373/ruby_store/pull/2.patch","issue_url":"https://api.github.com/repos/filip373/ruby_store/issues/2","number":2,"state":"open","locked":false,"title":"Web","user":{"login":"filip373","id":17977813,"avatar_url":"https://avatars.githubusercontent.com/u/17977813?v=3","gravatar_id":"","url":"https://api.github.com/users/filip373","html_url":"https://github.com/filip373","followers_url":"https://api.github.com/users/filip373/followers","following_url":"https://api.github.com/users/filip373/following{/other_user}","gists_url":"https://api.github.com/users/filip373/gists{/gist_id}","starred_url":"https://api.github.com/users/filip373/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/filip373/subscriptions","organizations_url":"https://api.github.com/users/filip373/orgs","repos_url":"https://api.github.com/users/filip373/repos","events_url":"https://api.github.com/users/filip373/events{/privacy}","received_events_url":"https://api.github.com/users/filip373/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-07-12T13:09:41Z","updated_at":"2016-07-12T13:19:34Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0494bed52c057f4c7d73ecf4f16408c0a36ea5aa","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/filip373/ruby_store/pulls/2/commits","review_comments_url":"https://api.github.com/repos/filip373/ruby_store/pulls/2/comments","review_comment_url":"https://api.github.com/repos/filip373/ruby_store/pulls/comments{/number}","comments_url":"https://api.github.com/repos/filip373/ruby_store/issues/2/comments","statuses_url":"https://api.github.com/repos/filip373/ruby_store/statuses/4bd2b6fd9ce9e23278e8693fb2a793966c556fba","head":{"label":"filip373:web","ref":"web","sha":"4bd2b6fd9ce9e23278e8693fb2a793966c556fba","user":{"login":"filip373","id":17977813,"avatar_url":"https://avatars.githubusercontent.com/u/17977813?v=3","gravatar_id":"","url":"https://api.github.com/users/filip373","html_url":"https://github.com/filip373","followers_url":"https://api.github.com/users/filip373/followers","following_url":"https://api.github.com/users/filip373/following{/other_user}","gists_url":"https://api.github.com/users/filip373/gists{/gist_id}","starred_url":"https://api.github.com/users/filip373/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/filip373/subscriptions","organizations_url":"https://api.github.com/users/filip373/orgs","repos_url":"https://api.github.com/users/filip373/repos","events_url":"https://api.github.com/users/filip373/events{/privacy}","received_events_url":"https://api.github.com/users/filip373/received_events","type":"User","site_admin":false},"repo":{"id":62719283,"name":"ruby_store","full_name":"filip373/ruby_store","owner":{"login":"filip373","id":17977813,"avatar_url":"https://avatars.githubusercontent.com/u/17977813?v=3","gravatar_id":"","url":"https://api.github.com/users/filip373","html_url":"https://github.com/filip373","followers_url":"https://api.github.com/users/filip373/followers","following_url":"https://api.github.com/users/filip373/following{/other_user}","gists_url":"https://api.github.com/users/filip373/gists{/gist_id}","starred_url":"https://api.github.com/users/filip373/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/filip373/subscriptions","organizations_url":"https://api.github.com/users/filip373/orgs","repos_url":"https://api.github.com/users/filip373/repos","events_url":"https://api.github.com/users/filip373/events{/privacy}","received_events_url":"https://api.github.com/users/filip373/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/filip373/ruby_store","description":"Simple store with basket and warehouse","fork":false,"url":"https://api.github.com/repos/filip373/ruby_store","forks_url":"https://api.github.com/repos/filip373/ruby_store/forks","keys_url":"https://api.github.com/repos/filip373/ruby_store/keys{/key_id}","collaborators_url":"https://api.github.com/repos/filip373/ruby_store/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/filip373/ruby_store/teams","hooks_url":"https://api.github.com/repos/filip373/ruby_store/hooks","issue_events_url":"https://api.github.com/repos/filip373/ruby_store/issues/events{/number}","events_url":"https://api.github.com/repos/filip373/ruby_store/events","assignees_url":"https://api.github.com/repos/filip373/ruby_store/assignees{/user}","branches_url":"https://api.github.com/repos/filip373/ruby_store/branches{/branch}","tags_url":"https://api.github.com/repos/filip373/ruby_store/tags","blobs_url":"https://api.github.com/repos/filip373/ruby_store/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/filip373/ruby_store/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/filip373/ruby_store/git/refs{/sha}","trees_url":"https://api.github.com/repos/filip373/ruby_store/git/trees{/sha}","statuses_url":"https://api.github.com/repos/filip373/ruby_store/statuses/{sha}","languages_url":"https://api.github.com/repos/filip373/ruby_store/languages","stargazers_url":"https://api.github.com/repos/filip373/ruby_store/stargazers","contributors_url":"https://api.github.com/repos/filip373/ruby_store/contributors","subscribers_url":"https://api.github.com/repos/filip373/ruby_store/subscribers","subscription_url":"https://api.github.com/repos/filip373/ruby_store/subscription","commits_url":"https://api.github.com/repos/filip373/ruby_store/commits{/sha}","git_commits_url":"https://api.github.com/repos/filip373/ruby_store/git/commits{/sha}","comments_url":"https://api.github.com/repos/filip373/ruby_store/comments{/number}","issue_comment_url":"https://api.github.com/repos/filip373/ruby_store/issues/comments{/number}","contents_url":"https://api.github.com/repos/filip373/ruby_store/contents/{+path}","compare_url":"https://api.github.com/repos/filip373/ruby_store/compare/{base}...{head}","merges_url":"https://api.github.com/repos/filip373/ruby_store/merges","archive_url":"https://api.github.com/repos/filip373/ruby_store/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/filip373/ruby_store/downloads","issues_url":"https://api.github.com/repos/filip373/ruby_store/issues{/number}","pulls_url":"https://api.github.com/repos/filip373/ruby_store/pulls{/number}","milestones_url":"https://api.github.com/repos/filip373/ruby_store/milestones{/number}","notifications_url":"https://api.github.com/repos/filip373/ruby_store/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/filip373/ruby_store/labels{/name}","releases_url":"https://api.github.com/repos/filip373/ruby_store/releases{/id}","deployments_url":"https://api.github.com/repos/filip373/ruby_store/deployments","created_at":"2016-07-06T12:27:41Z","updated_at":"2016-07-06T12:29:54Z","pushed_at":"2016-07-12T13:09:41Z","git_url":"git://github.com/filip373/ruby_store.git","ssh_url":"git@github.com:filip373/ruby_store.git","clone_url":"https://github.com/filip373/ruby_store.git","svn_url":"https://github.com/filip373/ruby_store","homepage":null,"size":26,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"filip373:master","ref":"master","sha":"17d0a2fc4ab88c9ed2437f5afdaaf582bd474dff","user":{"login":"filip373","id":17977813,"avatar_url":"https://avatars.githubusercontent.com/u/17977813?v=3","gravatar_id":"","url":"https://api.github.com/users/filip373","html_url":"https://github.com/filip373","followers_url":"https://api.github.com/users/filip373/followers","following_url":"https://api.github.com/users/filip373/following{/other_user}","gists_url":"https://api.github.com/users/filip373/gists{/gist_id}","starred_url":"https://api.github.com/users/filip373/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/filip373/subscriptions","organizations_url":"https://api.github.com/users/filip373/orgs","repos_url":"https://api.github.com/users/filip373/repos","events_url":"https://api.github.com/users/filip373/events{/privacy}","received_events_url":"https://api.github.com/users/filip373/received_events","type":"User","site_admin":false},"repo":{"id":62719283,"name":"ruby_store","full_name":"filip373/ruby_store","owner":{"login":"filip373","id":17977813,"avatar_url":"https://avatars.githubusercontent.com/u/17977813?v=3","gravatar_id":"","url":"https://api.github.com/users/filip373","html_url":"https://github.com/filip373","followers_url":"https://api.github.com/users/filip373/followers","following_url":"https://api.github.com/users/filip373/following{/other_user}","gists_url":"https://api.github.com/users/filip373/gists{/gist_id}","starred_url":"https://api.github.com/users/filip373/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/filip373/subscriptions","organizations_url":"https://api.github.com/users/filip373/orgs","repos_url":"https://api.github.com/users/filip373/repos","events_url":"https://api.github.com/users/filip373/events{/privacy}","received_events_url":"https://api.github.com/users/filip373/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/filip373/ruby_store","description":"Simple store with basket and warehouse","fork":false,"url":"https://api.github.com/repos/filip373/ruby_store","forks_url":"https://api.github.com/repos/filip373/ruby_store/forks","keys_url":"https://api.github.com/repos/filip373/ruby_store/keys{/key_id}","collaborators_url":"https://api.github.com/repos/filip373/ruby_store/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/filip373/ruby_store/teams","hooks_url":"https://api.github.com/repos/filip373/ruby_store/hooks","issue_events_url":"https://api.github.com/repos/filip373/ruby_store/issues/events{/number}","events_url":"https://api.github.com/repos/filip373/ruby_store/events","assignees_url":"https://api.github.com/repos/filip373/ruby_store/assignees{/user}","branches_url":"https://api.github.com/repos/filip373/ruby_store/branches{/branch}","tags_url":"https://api.github.com/repos/filip373/ruby_store/tags","blobs_url":"https://api.github.com/repos/filip373/ruby_store/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/filip373/ruby_store/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/filip373/ruby_store/git/refs{/sha}","trees_url":"https://api.github.com/repos/filip373/ruby_store/git/trees{/sha}","statuses_url":"https://api.github.com/repos/filip373/ruby_store/statuses/{sha}","languages_url":"https://api.github.com/repos/filip373/ruby_store/languages","stargazers_url":"https://api.github.com/repos/filip373/ruby_store/stargazers","contributors_url":"https://api.github.com/repos/filip373/ruby_store/contributors","subscribers_url":"https://api.github.com/repos/filip373/ruby_store/subscribers","subscription_url":"https://api.github.com/repos/filip373/ruby_store/subscription","commits_url":"https://api.github.com/repos/filip373/ruby_store/commits{/sha}","git_commits_url":"https://api.github.com/repos/filip373/ruby_store/git/commits{/sha}","comments_url":"https://api.github.com/repos/filip373/ruby_store/comments{/number}","issue_comment_url":"https://api.github.com/repos/filip373/ruby_store/issues/comments{/number}","contents_url":"https://api.github.com/repos/filip373/ruby_store/contents/{+path}","compare_url":"https://api.github.com/repos/filip373/ruby_store/compare/{base}...{head}","merges_url":"https://api.github.com/repos/filip373/ruby_store/merges","archive_url":"https://api.github.com/repos/filip373/ruby_store/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/filip373/ruby_store/downloads","issues_url":"https://api.github.com/repos/filip373/ruby_store/issues{/number}","pulls_url":"https://api.github.com/repos/filip373/ruby_store/pulls{/number}","milestones_url":"https://api.github.com/repos/filip373/ruby_store/milestones{/number}","notifications_url":"https://api.github.com/repos/filip373/ruby_store/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/filip373/ruby_store/labels{/name}","releases_url":"https://api.github.com/repos/filip373/ruby_store/releases{/id}","deployments_url":"https://api.github.com/repos/filip373/ruby_store/deployments","created_at":"2016-07-06T12:27:41Z","updated_at":"2016-07-06T12:29:54Z","pushed_at":"2016-07-12T13:09:41Z","git_url":"git://github.com/filip373/ruby_store.git","ssh_url":"git@github.com:filip373/ruby_store.git","clone_url":"https://github.com/filip373/ruby_store.git","svn_url":"https://github.com/filip373/ruby_store","homepage":null,"size":26,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/filip373/ruby_store/pulls/2"},"html":{"href":"https://github.com/filip373/ruby_store/pull/2"},"issue":{"href":"https://api.github.com/repos/filip373/ruby_store/issues/2"},"comments":{"href":"https://api.github.com/repos/filip373/ruby_store/issues/2/comments"},"review_comments":{"href":"https://api.github.com/repos/filip373/ruby_store/pulls/2/comments"},"review_comment":{"href":"https://api.github.com/repos/filip373/ruby_store/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/filip373/ruby_store/pulls/2/commits"},"statuses":{"href":"https://api.github.com/repos/filip373/ruby_store/statuses/4bd2b6fd9ce9e23278e8693fb2a793966c556fba"}}}}
{"actor":{"display_login":"gotar"}}