{"action":"created","comment":{"url":"https://api.github.com/repos/morganmiller/sales-engine/pulls/comments/28881549","id":28881549,"diff_hunk":"@@ -6,20 +6,100 @@ class InvoiceRepository\n \n   include LoadFile\n \n-    def initialize(sales_engine)\n-      @invoices = []\n-      @sales_engine = sales_engine\n+  def initialize(sales_engine)\n+    @invoices = []\n+    @sales_engine = sales_engine\n+  end\n+\n+  def load_data(path)\n+    file = load_file(path)\n+    @invoices = file.map do |line|\n+      Invoice.new(line, self)\n+    end\n+    file.close\n+  end\n+\n+  # def inspect\n+  #   \"#<#{self.class} #{@invoices.size} rows>\"\n+  # end\n+\n+  def all\n+    invoices\n+  end\n+\n+  def random\n+    invoices.sample\n+  end\n+\n+  def find_by_id(id)\n+    invoices.detect do |invoice|\n+      invoice.id == id\n+    end\n+  end\n+\n+  def find_by_customer_id(customer_id)\n+    invoices.detect do |invoice|\n+      invoice.customer_id == customer_id\n+    end\n+  end\n+\n+  def find_by_merchant_id(merchant_id)\n+    invoices.detect do |invoice|\n+      invoice.merchant_id == merchant_id\n+    end\n+  end\n+\n+  def find_by_status(status)","path":"lib/invoice_repository.rb","position":50,"original_position":50,"commit_id":"e9fd0bc9f672dfe99b5109d9c2775ea9799ceec2","original_commit_id":"e9fd0bc9f672dfe99b5109d9c2775ea9799ceec2","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":"Inconsistent indentation detected.","created_at":"2015-04-22T15:08:07Z","updated_at":"2015-04-22T15:08:07Z","html_url":"https://github.com/morganmiller/sales-engine/pull/14#discussion_r28881549","pull_request_url":"https://api.github.com/repos/morganmiller/sales-engine/pulls/14","_links":{"self":{"href":"https://api.github.com/repos/morganmiller/sales-engine/pulls/comments/28881549"},"html":{"href":"https://github.com/morganmiller/sales-engine/pull/14#discussion_r28881549"},"pull_request":{"href":"https://api.github.com/repos/morganmiller/sales-engine/pulls/14"}}},"pull_request":{"url":"https://api.github.com/repos/morganmiller/sales-engine/pulls/14","id":33867741,"html_url":"https://github.com/morganmiller/sales-engine/pull/14","diff_url":"https://github.com/morganmiller/sales-engine/pull/14.diff","patch_url":"https://github.com/morganmiller/sales-engine/pull/14.patch","issue_url":"https://api.github.com/repos/morganmiller/sales-engine/issues/14","number":14,"state":"open","locked":false,"title":"Merchant","user":{"login":"morganmiller","id":8868319,"avatar_url":"https://avatars.githubusercontent.com/u/8868319?v=3","gravatar_id":"","url":"https://api.github.com/users/morganmiller","html_url":"https://github.com/morganmiller","followers_url":"https://api.github.com/users/morganmiller/followers","following_url":"https://api.github.com/users/morganmiller/following{/other_user}","gists_url":"https://api.github.com/users/morganmiller/gists{/gist_id}","starred_url":"https://api.github.com/users/morganmiller/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/morganmiller/subscriptions","organizations_url":"https://api.github.com/users/morganmiller/orgs","repos_url":"https://api.github.com/users/morganmiller/repos","events_url":"https://api.github.com/users/morganmiller/events{/privacy}","received_events_url":"https://api.github.com/users/morganmiller/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-04-22T15:07:53Z","updated_at":"2015-04-22T15:08:07Z","closed_at":null,"merged_at":null,"merge_commit_sha":"cdac7bb1c14d6c7eea25270867b8efe61b73b522","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/morganmiller/sales-engine/pulls/14/commits","review_comments_url":"https://api.github.com/repos/morganmiller/sales-engine/pulls/14/comments","review_comment_url":"https://api.github.com/repos/morganmiller/sales-engine/pulls/comments{/number}","comments_url":"https://api.github.com/repos/morganmiller/sales-engine/issues/14/comments","statuses_url":"https://api.github.com/repos/morganmiller/sales-engine/statuses/e9fd0bc9f672dfe99b5109d9c2775ea9799ceec2","head":{"label":"morganmiller:merchant","ref":"merchant","sha":"e9fd0bc9f672dfe99b5109d9c2775ea9799ceec2","user":{"login":"morganmiller","id":8868319,"avatar_url":"https://avatars.githubusercontent.com/u/8868319?v=3","gravatar_id":"","url":"https://api.github.com/users/morganmiller","html_url":"https://github.com/morganmiller","followers_url":"https://api.github.com/users/morganmiller/followers","following_url":"https://api.github.com/users/morganmiller/following{/other_user}","gists_url":"https://api.github.com/users/morganmiller/gists{/gist_id}","starred_url":"https://api.github.com/users/morganmiller/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/morganmiller/subscriptions","organizations_url":"https://api.github.com/users/morganmiller/orgs","repos_url":"https://api.github.com/users/morganmiller/repos","events_url":"https://api.github.com/users/morganmiller/events{/privacy}","received_events_url":"https://api.github.com/users/morganmiller/received_events","type":"User","site_admin":false},"repo":{"id":34334518,"name":"sales-engine","full_name":"morganmiller/sales-engine","owner":{"login":"morganmiller","id":8868319,"avatar_url":"https://avatars.githubusercontent.com/u/8868319?v=3","gravatar_id":"","url":"https://api.github.com/users/morganmiller","html_url":"https://github.com/morganmiller","followers_url":"https://api.github.com/users/morganmiller/followers","following_url":"https://api.github.com/users/morganmiller/following{/other_user}","gists_url":"https://api.github.com/users/morganmiller/gists{/gist_id}","starred_url":"https://api.github.com/users/morganmiller/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/morganmiller/subscriptions","organizations_url":"https://api.github.com/users/morganmiller/orgs","repos_url":"https://api.github.com/users/morganmiller/repos","events_url":"https://api.github.com/users/morganmiller/events{/privacy}","received_events_url":"https://api.github.com/users/morganmiller/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/morganmiller/sales-engine","description":"","fork":false,"url":"https://api.github.com/repos/morganmiller/sales-engine","forks_url":"https://api.github.com/repos/morganmiller/sales-engine/forks","keys_url":"https://api.github.com/repos/morganmiller/sales-engine/keys{/key_id}","collaborators_url":"https://api.github.com/repos/morganmiller/sales-engine/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/morganmiller/sales-engine/teams","hooks_url":"https://api.github.com/repos/morganmiller/sales-engine/hooks","issue_events_url":"https://api.github.com/repos/morganmiller/sales-engine/issues/events{/number}","events_url":"https://api.github.com/repos/morganmiller/sales-engine/events","assignees_url":"https://api.github.com/repos/morganmiller/sales-engine/assignees{/user}","branches_url":"https://api.github.com/repos/morganmiller/sales-engine/branches{/branch}","tags_url":"https://api.github.com/repos/morganmiller/sales-engine/tags","blobs_url":"https://api.github.com/repos/morganmiller/sales-engine/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/morganmiller/sales-engine/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/morganmiller/sales-engine/git/refs{/sha}","trees_url":"https://api.github.com/repos/morganmiller/sales-engine/git/trees{/sha}","statuses_url":"https://api.github.com/repos/morganmiller/sales-engine/statuses/{sha}","languages_url":"https://api.github.com/repos/morganmiller/sales-engine/languages","stargazers_url":"https://api.github.com/repos/morganmiller/sales-engine/stargazers","contributors_url":"https://api.github.com/repos/morganmiller/sales-engine/contributors","subscribers_url":"https://api.github.com/repos/morganmiller/sales-engine/subscribers","subscription_url":"https://api.github.com/repos/morganmiller/sales-engine/subscription","commits_url":"https://api.github.com/repos/morganmiller/sales-engine/commits{/sha}","git_commits_url":"https://api.github.com/repos/morganmiller/sales-engine/git/commits{/sha}","comments_url":"https://api.github.com/repos/morganmiller/sales-engine/comments{/number}","issue_comment_url":"https://api.github.com/repos/morganmiller/sales-engine/issues/comments{/number}","contents_url":"https://api.github.com/repos/morganmiller/sales-engine/contents/{+path}","compare_url":"https://api.github.com/repos/morganmiller/sales-engine/compare/{base}...{head}","merges_url":"https://api.github.com/repos/morganmiller/sales-engine/merges","archive_url":"https://api.github.com/repos/morganmiller/sales-engine/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/morganmiller/sales-engine/downloads","issues_url":"https://api.github.com/repos/morganmiller/sales-engine/issues{/number}","pulls_url":"https://api.github.com/repos/morganmiller/sales-engine/pulls{/number}","milestones_url":"https://api.github.com/repos/morganmiller/sales-engine/milestones{/number}","notifications_url":"https://api.github.com/repos/morganmiller/sales-engine/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/morganmiller/sales-engine/labels{/name}","releases_url":"https://api.github.com/repos/morganmiller/sales-engine/releases{/id}","created_at":"2015-04-21T15:09:10Z","updated_at":"2015-04-21T22:35:00Z","pushed_at":"2015-04-22T15:07:53Z","git_url":"git://github.com/morganmiller/sales-engine.git","ssh_url":"git@github.com:morganmiller/sales-engine.git","clone_url":"https://github.com/morganmiller/sales-engine.git","svn_url":"https://github.com/morganmiller/sales-engine","homepage":null,"size":0,"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":7,"forks":0,"open_issues":7,"watchers":0,"default_branch":"master"}},"base":{"label":"morganmiller:master","ref":"master","sha":"d78e9b982fb3fb3f267a8ddb4702f7a8fa496d14","user":{"login":"morganmiller","id":8868319,"avatar_url":"https://avatars.githubusercontent.com/u/8868319?v=3","gravatar_id":"","url":"https://api.github.com/users/morganmiller","html_url":"https://github.com/morganmiller","followers_url":"https://api.github.com/users/morganmiller/followers","following_url":"https://api.github.com/users/morganmiller/following{/other_user}","gists_url":"https://api.github.com/users/morganmiller/gists{/gist_id}","starred_url":"https://api.github.com/users/morganmiller/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/morganmiller/subscriptions","organizations_url":"https://api.github.com/users/morganmiller/orgs","repos_url":"https://api.github.com/users/morganmiller/repos","events_url":"https://api.github.com/users/morganmiller/events{/privacy}","received_events_url":"https://api.github.com/users/morganmiller/received_events","type":"User","site_admin":false},"repo":{"id":34334518,"name":"sales-engine","full_name":"morganmiller/sales-engine","owner":{"login":"morganmiller","id":8868319,"avatar_url":"https://avatars.githubusercontent.com/u/8868319?v=3","gravatar_id":"","url":"https://api.github.com/users/morganmiller","html_url":"https://github.com/morganmiller","followers_url":"https://api.github.com/users/morganmiller/followers","following_url":"https://api.github.com/users/morganmiller/following{/other_user}","gists_url":"https://api.github.com/users/morganmiller/gists{/gist_id}","starred_url":"https://api.github.com/users/morganmiller/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/morganmiller/subscriptions","organizations_url":"https://api.github.com/users/morganmiller/orgs","repos_url":"https://api.github.com/users/morganmiller/repos","events_url":"https://api.github.com/users/morganmiller/events{/privacy}","received_events_url":"https://api.github.com/users/morganmiller/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/morganmiller/sales-engine","description":"","fork":false,"url":"https://api.github.com/repos/morganmiller/sales-engine","forks_url":"https://api.github.com/repos/morganmiller/sales-engine/forks","keys_url":"https://api.github.com/repos/morganmiller/sales-engine/keys{/key_id}","collaborators_url":"https://api.github.com/repos/morganmiller/sales-engine/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/morganmiller/sales-engine/teams","hooks_url":"https://api.github.com/repos/morganmiller/sales-engine/hooks","issue_events_url":"https://api.github.com/repos/morganmiller/sales-engine/issues/events{/number}","events_url":"https://api.github.com/repos/morganmiller/sales-engine/events","assignees_url":"https://api.github.com/repos/morganmiller/sales-engine/assignees{/user}","branches_url":"https://api.github.com/repos/morganmiller/sales-engine/branches{/branch}","tags_url":"https://api.github.com/repos/morganmiller/sales-engine/tags","blobs_url":"https://api.github.com/repos/morganmiller/sales-engine/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/morganmiller/sales-engine/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/morganmiller/sales-engine/git/refs{/sha}","trees_url":"https://api.github.com/repos/morganmiller/sales-engine/git/trees{/sha}","statuses_url":"https://api.github.com/repos/morganmiller/sales-engine/statuses/{sha}","languages_url":"https://api.github.com/repos/morganmiller/sales-engine/languages","stargazers_url":"https://api.github.com/repos/morganmiller/sales-engine/stargazers","contributors_url":"https://api.github.com/repos/morganmiller/sales-engine/contributors","subscribers_url":"https://api.github.com/repos/morganmiller/sales-engine/subscribers","subscription_url":"https://api.github.com/repos/morganmiller/sales-engine/subscription","commits_url":"https://api.github.com/repos/morganmiller/sales-engine/commits{/sha}","git_commits_url":"https://api.github.com/repos/morganmiller/sales-engine/git/commits{/sha}","comments_url":"https://api.github.com/repos/morganmiller/sales-engine/comments{/number}","issue_comment_url":"https://api.github.com/repos/morganmiller/sales-engine/issues/comments{/number}","contents_url":"https://api.github.com/repos/morganmiller/sales-engine/contents/{+path}","compare_url":"https://api.github.com/repos/morganmiller/sales-engine/compare/{base}...{head}","merges_url":"https://api.github.com/repos/morganmiller/sales-engine/merges","archive_url":"https://api.github.com/repos/morganmiller/sales-engine/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/morganmiller/sales-engine/downloads","issues_url":"https://api.github.com/repos/morganmiller/sales-engine/issues{/number}","pulls_url":"https://api.github.com/repos/morganmiller/sales-engine/pulls{/number}","milestones_url":"https://api.github.com/repos/morganmiller/sales-engine/milestones{/number}","notifications_url":"https://api.github.com/repos/morganmiller/sales-engine/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/morganmiller/sales-engine/labels{/name}","releases_url":"https://api.github.com/repos/morganmiller/sales-engine/releases{/id}","created_at":"2015-04-21T15:09:10Z","updated_at":"2015-04-21T22:35:00Z","pushed_at":"2015-04-22T15:07:53Z","git_url":"git://github.com/morganmiller/sales-engine.git","ssh_url":"git@github.com:morganmiller/sales-engine.git","clone_url":"https://github.com/morganmiller/sales-engine.git","svn_url":"https://github.com/morganmiller/sales-engine","homepage":null,"size":0,"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":7,"forks":0,"open_issues":7,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/morganmiller/sales-engine/pulls/14"},"html":{"href":"https://github.com/morganmiller/sales-engine/pull/14"},"issue":{"href":"https://api.github.com/repos/morganmiller/sales-engine/issues/14"},"comments":{"href":"https://api.github.com/repos/morganmiller/sales-engine/issues/14/comments"},"review_comments":{"href":"https://api.github.com/repos/morganmiller/sales-engine/pulls/14/comments"},"review_comment":{"href":"https://api.github.com/repos/morganmiller/sales-engine/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/morganmiller/sales-engine/pulls/14/commits"},"statuses":{"href":"https://api.github.com/repos/morganmiller/sales-engine/statuses/e9fd0bc9f672dfe99b5109d9c2775ea9799ceec2"}}}}