{"action":"created","comment":{"url":"https://api.github.com/repos/pollockcl/black_thursday/pulls/comments/168973278","pull_request_review_id":97424248,"id":168973278,"diff_hunk":"@@ -0,0 +1,65 @@\n+require 'bigdecimal'\n+# This is the Arithmatic module\n+module Arithmetic\n+  def avg_items_per_merchant(sales_engine)\n+    BigDecimal(sales_engine.items.size) / BigDecimal(sales_engine.merchants.size)\n+  end\n+\n+  def sum_diff_means_items_per_merchant_squared(sales_engine)\n+    sales_engine.merchants.all.map do |merchant|\n+      (merchant.items.size - avg_items_per_merchant(sales_engine))**2\n+    end.sum\n+  end\n+\n+  def variance_items_per_merchant(sales_engine)\n+    sum_diff_means_items_per_merchant_squared(sales_engine) /\\\n+      (sales_engine.merchants.size - 1)\n+  end\n+\n+  def std_deviation_items_per_merchant(sales_engine)\n+    Math.sqrt(variance_items_per_merchant(sales_engine))\n+  end\n+\n+  def total_units_for_merchant(sales_engine, id)\n+    BigDecimal(sales_engine.items.find_all_by_merchant_id(id).size)\n+  end\n+\n+  def sum_unit_prices_for_merchant(sales_engine, id)\n+    sales_engine.items.find_all_by_merchant_id(id).reduce(BigDecimal.new(0)) do |sum, item|\n+      sum += item.unit_price_to_dollars\n+    end\n+  end\n+\n+  # moved core formula here because of the need to carry out division over two lines","path":"lib/arithmetic.rb","position":33,"original_position":33,"commit_id":"449f681623b2c2b61e77a3cdd3eff6ac518c3c2f","original_commit_id":"449f681623b2c2b61e77a3cdd3eff6ac518c3c2f","user":{"login":"houndci-bot","id":6697940,"avatar_url":"https://avatars0.githubusercontent.com/u/6697940?v=4","gravatar_id":"","url":"https://api.github.com/users/houndci-bot","html_url":"https://github.com/houndci-bot","followers_url":"https://api.github.com/users/houndci-bot/followers","following_url":"https://api.github.com/users/houndci-bot/following{/other_user}","gists_url":"https://api.github.com/users/houndci-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci-bot/subscriptions","organizations_url":"https://api.github.com/users/houndci-bot/orgs","repos_url":"https://api.github.com/users/houndci-bot/repos","events_url":"https://api.github.com/users/houndci-bot/events{/privacy}","received_events_url":"https://api.github.com/users/houndci-bot/received_events","type":"User","site_admin":false},"body":"Line is too long. [84/80]","created_at":"2018-02-19T00:47:35Z","updated_at":"2018-02-19T00:47:36Z","html_url":"https://github.com/pollockcl/black_thursday/pull/7#discussion_r168973278","pull_request_url":"https://api.github.com/repos/pollockcl/black_thursday/pulls/7","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/pollockcl/black_thursday/pulls/comments/168973278"},"html":{"href":"https://github.com/pollockcl/black_thursday/pull/7#discussion_r168973278"},"pull_request":{"href":"https://api.github.com/repos/pollockcl/black_thursday/pulls/7"}}},"pull_request":{"url":"https://api.github.com/repos/pollockcl/black_thursday/pulls/7","id":169860866,"html_url":"https://github.com/pollockcl/black_thursday/pull/7","diff_url":"https://github.com/pollockcl/black_thursday/pull/7.diff","patch_url":"https://github.com/pollockcl/black_thursday/pull/7.patch","issue_url":"https://api.github.com/repos/pollockcl/black_thursday/issues/7","number":7,"state":"open","locked":false,"title":"Clee iteration one refactor","user":{"login":"pollockcl","id":34550301,"avatar_url":"https://avatars0.githubusercontent.com/u/34550301?v=4","gravatar_id":"","url":"https://api.github.com/users/pollockcl","html_url":"https://github.com/pollockcl","followers_url":"https://api.github.com/users/pollockcl/followers","following_url":"https://api.github.com/users/pollockcl/following{/other_user}","gists_url":"https://api.github.com/users/pollockcl/gists{/gist_id}","starred_url":"https://api.github.com/users/pollockcl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pollockcl/subscriptions","organizations_url":"https://api.github.com/users/pollockcl/orgs","repos_url":"https://api.github.com/users/pollockcl/repos","events_url":"https://api.github.com/users/pollockcl/events{/privacy}","received_events_url":"https://api.github.com/users/pollockcl/received_events","type":"User","site_admin":false},"body":"Just refactoring what we had.","created_at":"2018-02-19T00:47:20Z","updated_at":"2018-02-19T00:47:36Z","closed_at":null,"merged_at":null,"merge_commit_sha":"37f04187e52241840a092afe54efe24c379f297d","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":839527388,"url":"https://api.github.com/repos/pollockcl/black_thursday/labels/review","name":"review","color":"ededed","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/pollockcl/black_thursday/pulls/7/commits","review_comments_url":"https://api.github.com/repos/pollockcl/black_thursday/pulls/7/comments","review_comment_url":"https://api.github.com/repos/pollockcl/black_thursday/pulls/comments{/number}","comments_url":"https://api.github.com/repos/pollockcl/black_thursday/issues/7/comments","statuses_url":"https://api.github.com/repos/pollockcl/black_thursday/statuses/449f681623b2c2b61e77a3cdd3eff6ac518c3c2f","head":{"label":"pollockcl:clee_iteration_one_refactor","ref":"clee_iteration_one_refactor","sha":"449f681623b2c2b61e77a3cdd3eff6ac518c3c2f","user":{"login":"pollockcl","id":34550301,"avatar_url":"https://avatars0.githubusercontent.com/u/34550301?v=4","gravatar_id":"","url":"https://api.github.com/users/pollockcl","html_url":"https://github.com/pollockcl","followers_url":"https://api.github.com/users/pollockcl/followers","following_url":"https://api.github.com/users/pollockcl/following{/other_user}","gists_url":"https://api.github.com/users/pollockcl/gists{/gist_id}","starred_url":"https://api.github.com/users/pollockcl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pollockcl/subscriptions","organizations_url":"https://api.github.com/users/pollockcl/orgs","repos_url":"https://api.github.com/users/pollockcl/repos","events_url":"https://api.github.com/users/pollockcl/events{/privacy}","received_events_url":"https://api.github.com/users/pollockcl/received_events","type":"User","site_admin":false},"repo":{"id":121798167,"name":"black_thursday","full_name":"pollockcl/black_thursday","owner":{"login":"pollockcl","id":34550301,"avatar_url":"https://avatars0.githubusercontent.com/u/34550301?v=4","gravatar_id":"","url":"https://api.github.com/users/pollockcl","html_url":"https://github.com/pollockcl","followers_url":"https://api.github.com/users/pollockcl/followers","following_url":"https://api.github.com/users/pollockcl/following{/other_user}","gists_url":"https://api.github.com/users/pollockcl/gists{/gist_id}","starred_url":"https://api.github.com/users/pollockcl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pollockcl/subscriptions","organizations_url":"https://api.github.com/users/pollockcl/orgs","repos_url":"https://api.github.com/users/pollockcl/repos","events_url":"https://api.github.com/users/pollockcl/events{/privacy}","received_events_url":"https://api.github.com/users/pollockcl/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/pollockcl/black_thursday","description":null,"fork":true,"url":"https://api.github.com/repos/pollockcl/black_thursday","forks_url":"https://api.github.com/repos/pollockcl/black_thursday/forks","keys_url":"https://api.github.com/repos/pollockcl/black_thursday/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pollockcl/black_thursday/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pollockcl/black_thursday/teams","hooks_url":"https://api.github.com/repos/pollockcl/black_thursday/hooks","issue_events_url":"https://api.github.com/repos/pollockcl/black_thursday/issues/events{/number}","events_url":"https://api.github.com/repos/pollockcl/black_thursday/events","assignees_url":"https://api.github.com/repos/pollockcl/black_thursday/assignees{/user}","branches_url":"https://api.github.com/repos/pollockcl/black_thursday/branches{/branch}","tags_url":"https://api.github.com/repos/pollockcl/black_thursday/tags","blobs_url":"https://api.github.com/repos/pollockcl/black_thursday/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pollockcl/black_thursday/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pollockcl/black_thursday/git/refs{/sha}","trees_url":"https://api.github.com/repos/pollockcl/black_thursday/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pollockcl/black_thursday/statuses/{sha}","languages_url":"https://api.github.com/repos/pollockcl/black_thursday/languages","stargazers_url":"https://api.github.com/repos/pollockcl/black_thursday/stargazers","contributors_url":"https://api.github.com/repos/pollockcl/black_thursday/contributors","subscribers_url":"https://api.github.com/repos/pollockcl/black_thursday/subscribers","subscription_url":"https://api.github.com/repos/pollockcl/black_thursday/subscription","commits_url":"https://api.github.com/repos/pollockcl/black_thursday/commits{/sha}","git_commits_url":"https://api.github.com/repos/pollockcl/black_thursday/git/commits{/sha}","comments_url":"https://api.github.com/repos/pollockcl/black_thursday/comments{/number}","issue_comment_url":"https://api.github.com/repos/pollockcl/black_thursday/issues/comments{/number}","contents_url":"https://api.github.com/repos/pollockcl/black_thursday/contents/{+path}","compare_url":"https://api.github.com/repos/pollockcl/black_thursday/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pollockcl/black_thursday/merges","archive_url":"https://api.github.com/repos/pollockcl/black_thursday/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pollockcl/black_thursday/downloads","issues_url":"https://api.github.com/repos/pollockcl/black_thursday/issues{/number}","pulls_url":"https://api.github.com/repos/pollockcl/black_thursday/pulls{/number}","milestones_url":"https://api.github.com/repos/pollockcl/black_thursday/milestones{/number}","notifications_url":"https://api.github.com/repos/pollockcl/black_thursday/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pollockcl/black_thursday/labels{/name}","releases_url":"https://api.github.com/repos/pollockcl/black_thursday/releases{/id}","deployments_url":"https://api.github.com/repos/pollockcl/black_thursday/deployments","created_at":"2018-02-16T20:37:30Z","updated_at":"2018-02-17T23:25:49Z","pushed_at":"2018-02-19T00:47:21Z","git_url":"git://github.com/pollockcl/black_thursday.git","ssh_url":"git@github.com:pollockcl/black_thursday.git","clone_url":"https://github.com/pollockcl/black_thursday.git","svn_url":"https://github.com/pollockcl/black_thursday","homepage":null,"size":1827,"stargazers_count":0,"watchers_count":0,"language":"HTML","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":null,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"pollockcl:master","ref":"master","sha":"f935ecaa824b9a8222fb1e6608651f5f462e967b","user":{"login":"pollockcl","id":34550301,"avatar_url":"https://avatars0.githubusercontent.com/u/34550301?v=4","gravatar_id":"","url":"https://api.github.com/users/pollockcl","html_url":"https://github.com/pollockcl","followers_url":"https://api.github.com/users/pollockcl/followers","following_url":"https://api.github.com/users/pollockcl/following{/other_user}","gists_url":"https://api.github.com/users/pollockcl/gists{/gist_id}","starred_url":"https://api.github.com/users/pollockcl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pollockcl/subscriptions","organizations_url":"https://api.github.com/users/pollockcl/orgs","repos_url":"https://api.github.com/users/pollockcl/repos","events_url":"https://api.github.com/users/pollockcl/events{/privacy}","received_events_url":"https://api.github.com/users/pollockcl/received_events","type":"User","site_admin":false},"repo":{"id":121798167,"name":"black_thursday","full_name":"pollockcl/black_thursday","owner":{"login":"pollockcl","id":34550301,"avatar_url":"https://avatars0.githubusercontent.com/u/34550301?v=4","gravatar_id":"","url":"https://api.github.com/users/pollockcl","html_url":"https://github.com/pollockcl","followers_url":"https://api.github.com/users/pollockcl/followers","following_url":"https://api.github.com/users/pollockcl/following{/other_user}","gists_url":"https://api.github.com/users/pollockcl/gists{/gist_id}","starred_url":"https://api.github.com/users/pollockcl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pollockcl/subscriptions","organizations_url":"https://api.github.com/users/pollockcl/orgs","repos_url":"https://api.github.com/users/pollockcl/repos","events_url":"https://api.github.com/users/pollockcl/events{/privacy}","received_events_url":"https://api.github.com/users/pollockcl/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/pollockcl/black_thursday","description":null,"fork":true,"url":"https://api.github.com/repos/pollockcl/black_thursday","forks_url":"https://api.github.com/repos/pollockcl/black_thursday/forks","keys_url":"https://api.github.com/repos/pollockcl/black_thursday/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pollockcl/black_thursday/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pollockcl/black_thursday/teams","hooks_url":"https://api.github.com/repos/pollockcl/black_thursday/hooks","issue_events_url":"https://api.github.com/repos/pollockcl/black_thursday/issues/events{/number}","events_url":"https://api.github.com/repos/pollockcl/black_thursday/events","assignees_url":"https://api.github.com/repos/pollockcl/black_thursday/assignees{/user}","branches_url":"https://api.github.com/repos/pollockcl/black_thursday/branches{/branch}","tags_url":"https://api.github.com/repos/pollockcl/black_thursday/tags","blobs_url":"https://api.github.com/repos/pollockcl/black_thursday/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pollockcl/black_thursday/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pollockcl/black_thursday/git/refs{/sha}","trees_url":"https://api.github.com/repos/pollockcl/black_thursday/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pollockcl/black_thursday/statuses/{sha}","languages_url":"https://api.github.com/repos/pollockcl/black_thursday/languages","stargazers_url":"https://api.github.com/repos/pollockcl/black_thursday/stargazers","contributors_url":"https://api.github.com/repos/pollockcl/black_thursday/contributors","subscribers_url":"https://api.github.com/repos/pollockcl/black_thursday/subscribers","subscription_url":"https://api.github.com/repos/pollockcl/black_thursday/subscription","commits_url":"https://api.github.com/repos/pollockcl/black_thursday/commits{/sha}","git_commits_url":"https://api.github.com/repos/pollockcl/black_thursday/git/commits{/sha}","comments_url":"https://api.github.com/repos/pollockcl/black_thursday/comments{/number}","issue_comment_url":"https://api.github.com/repos/pollockcl/black_thursday/issues/comments{/number}","contents_url":"https://api.github.com/repos/pollockcl/black_thursday/contents/{+path}","compare_url":"https://api.github.com/repos/pollockcl/black_thursday/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pollockcl/black_thursday/merges","archive_url":"https://api.github.com/repos/pollockcl/black_thursday/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pollockcl/black_thursday/downloads","issues_url":"https://api.github.com/repos/pollockcl/black_thursday/issues{/number}","pulls_url":"https://api.github.com/repos/pollockcl/black_thursday/pulls{/number}","milestones_url":"https://api.github.com/repos/pollockcl/black_thursday/milestones{/number}","notifications_url":"https://api.github.com/repos/pollockcl/black_thursday/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pollockcl/black_thursday/labels{/name}","releases_url":"https://api.github.com/repos/pollockcl/black_thursday/releases{/id}","deployments_url":"https://api.github.com/repos/pollockcl/black_thursday/deployments","created_at":"2018-02-16T20:37:30Z","updated_at":"2018-02-17T23:25:49Z","pushed_at":"2018-02-19T00:47:21Z","git_url":"git://github.com/pollockcl/black_thursday.git","ssh_url":"git@github.com:pollockcl/black_thursday.git","clone_url":"https://github.com/pollockcl/black_thursday.git","svn_url":"https://github.com/pollockcl/black_thursday","homepage":null,"size":1827,"stargazers_count":0,"watchers_count":0,"language":"HTML","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":null,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/pollockcl/black_thursday/pulls/7"},"html":{"href":"https://github.com/pollockcl/black_thursday/pull/7"},"issue":{"href":"https://api.github.com/repos/pollockcl/black_thursday/issues/7"},"comments":{"href":"https://api.github.com/repos/pollockcl/black_thursday/issues/7/comments"},"review_comments":{"href":"https://api.github.com/repos/pollockcl/black_thursday/pulls/7/comments"},"review_comment":{"href":"https://api.github.com/repos/pollockcl/black_thursday/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/pollockcl/black_thursday/pulls/7/commits"},"statuses":{"href":"https://api.github.com/repos/pollockcl/black_thursday/statuses/449f681623b2c2b61e77a3cdd3eff6ac518c3c2f"}},"author_association":"OWNER"}}
{"actor":{"display_login":"houndci-bot"}}