{"action":"created","comment":{"url":"https://api.github.com/repos/Ada-C9/grocery-store/pulls/comments/170153002","pull_request_review_id":98797306,"id":170153002,"diff_hunk":"@@ -0,0 +1,64 @@\n+require 'csv'\n+require 'awesome_print'\n+\n+#_______________ Grocery::Customer _______________\n+\n+module Grocery\n+  class Customer\n+\n+    attr_reader :costumer_id, :email, :address\n+\n+    # Initialize class Customer:\n+    def initialize(costumer_id, email, customer_address)\n+      @costumer_id = costumer_id\n+      @email = email\n+      @address = customer_address\n+    end\n+\n+\n+    #############################################################################################\n+    # ALL CUSTOMERS:\n+\n+    # self.all - returns a collection of OnlineOrder instances, representing all of the OnlineOrders described in the CSV. See below for the CSV file specifications\n+    def self.all\n+\n+      @all_customers = []\n+\n+      # Read file:\n+      file_to_read = CSV.read('../support/customers.csv', 'r')\n+\n+      file_to_read.each do |row|\n+\n+        #Select the order costumer_id number from the file and assign it:\n+        costumer_id = row[0].to_i\n+        email = row[1]\n+        customer_address = \"#{row[2]}, #{row[3]}, #{row[4]}, #{row[5]}\"\n+\n+        # Create new customer:\n+        new_customer = Customer.new(costumer_id, email, customer_address)\n+\n+        # Push this customer to all_custumers array\n+        @all_customers << new_customer\n+      end\n+      return @all_customers\n+\n+    end\n+\n+    #############################################################################################\n+    # FIND CUSTOMERS:\n+\n+    def self.find(find_costumer_id)\n+       found_customer = nil\n+       @all_customers.each do |customer|\n+         if customer.costumer_id == find_costumer_id\n+           found_customer = customer\n+         end\n+       end\n+       unless found_customer != nil\n+         raise ArgumentError.new(\"Customer doesn't exist.\")\n+       end\n+       return found_customer\n+     end","path":"lib/customer.rb","position":61,"original_position":61,"commit_id":"84ad76e220cf1fbc372187b1b938ddf61a154f57","original_commit_id":"84ad76e220cf1fbc372187b1b938ddf61a154f57","user":{"login":"CheezItMan","id":1177416,"avatar_url":"https://avatars3.githubusercontent.com/u/1177416?v=4","gravatar_id":"","url":"https://api.github.com/users/CheezItMan","html_url":"https://github.com/CheezItMan","followers_url":"https://api.github.com/users/CheezItMan/followers","following_url":"https://api.github.com/users/CheezItMan/following{/other_user}","gists_url":"https://api.github.com/users/CheezItMan/gists{/gist_id}","starred_url":"https://api.github.com/users/CheezItMan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CheezItMan/subscriptions","organizations_url":"https://api.github.com/users/CheezItMan/orgs","repos_url":"https://api.github.com/users/CheezItMan/repos","events_url":"https://api.github.com/users/CheezItMan/events{/privacy}","received_events_url":"https://api.github.com/users/CheezItMan/received_events","type":"User","site_admin":false},"body":"mismatched `end` make sure your code is aligned properly.","created_at":"2018-02-23T02:36:50Z","updated_at":"2018-02-23T02:54:46Z","html_url":"https://github.com/Ada-C9/grocery-store/pull/20#discussion_r170153002","pull_request_url":"https://api.github.com/repos/Ada-C9/grocery-store/pulls/20","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/Ada-C9/grocery-store/pulls/comments/170153002"},"html":{"href":"https://github.com/Ada-C9/grocery-store/pull/20#discussion_r170153002"},"pull_request":{"href":"https://api.github.com/repos/Ada-C9/grocery-store/pulls/20"}}},"pull_request":{"url":"https://api.github.com/repos/Ada-C9/grocery-store/pulls/20","id":170114719,"html_url":"https://github.com/Ada-C9/grocery-store/pull/20","diff_url":"https://github.com/Ada-C9/grocery-store/pull/20.diff","patch_url":"https://github.com/Ada-C9/grocery-store/pull/20.patch","issue_url":"https://api.github.com/repos/Ada-C9/grocery-store/issues/20","number":20,"state":"open","locked":false,"title":"(Ampers) Leticia Tran","user":{"login":"LeticiaTran","id":29556476,"avatar_url":"https://avatars1.githubusercontent.com/u/29556476?v=4","gravatar_id":"","url":"https://api.github.com/users/LeticiaTran","html_url":"https://github.com/LeticiaTran","followers_url":"https://api.github.com/users/LeticiaTran/followers","following_url":"https://api.github.com/users/LeticiaTran/following{/other_user}","gists_url":"https://api.github.com/users/LeticiaTran/gists{/gist_id}","starred_url":"https://api.github.com/users/LeticiaTran/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LeticiaTran/subscriptions","organizations_url":"https://api.github.com/users/LeticiaTran/orgs","repos_url":"https://api.github.com/users/LeticiaTran/repos","events_url":"https://api.github.com/users/LeticiaTran/events{/privacy}","received_events_url":"https://api.github.com/users/LeticiaTran/received_events","type":"User","site_admin":false},"body":"# Grocery Store\r\nCongratulations! You're submitting your assignment.\r\n\r\n## Comprehension Questions\r\n\r\n|  Question \t|   Response\t|\r\n|---\t|---\t|\r\n|   Why is it useful to put classes inside modules? \t|   It is useful because it allows us to group those classes and methods together and also inherit behaviors and instances between them.  |\r\n|   What is accomplished with `raise ArgumentError`? \t|   When raising an ArgumentError it possible to clarify for the user that there is an error due to the argument that is being passed, for example, that it is the wrong number of arguments or that it is an argument that is not acceptable. |\r\n|   Why do you think we made the `.all` & `.find` methods class methods?  Why not instance methods?\t|   Class methods allows us to use the information of the whole class, and not just the one on that particular instance method. \t|\r\n|   Why does it make sense to use inheritance for the online order?  | The OnlineOrder class requires code that is very similar to the Order class, for methods and variables. |\r\n|   Did the presence of automated tests change the way you thought about the problem? How? | Yes. In the first wave it helped me a lot, by guiding me on what results I needed from the program. However, when writing the tests myself, for the third wave specially, I ended up writing the code first and then the tests. |","created_at":"2018-02-20T07:03:16Z","updated_at":"2018-02-23T02:54:46Z","closed_at":null,"merged_at":null,"merge_commit_sha":"48ceeed070015f232a586188e9f344172becae51","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/Ada-C9/grocery-store/pulls/20/commits","review_comments_url":"https://api.github.com/repos/Ada-C9/grocery-store/pulls/20/comments","review_comment_url":"https://api.github.com/repos/Ada-C9/grocery-store/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Ada-C9/grocery-store/issues/20/comments","statuses_url":"https://api.github.com/repos/Ada-C9/grocery-store/statuses/84ad76e220cf1fbc372187b1b938ddf61a154f57","head":{"label":"LeticiaTran:master","ref":"master","sha":"84ad76e220cf1fbc372187b1b938ddf61a154f57","user":{"login":"LeticiaTran","id":29556476,"avatar_url":"https://avatars1.githubusercontent.com/u/29556476?v=4","gravatar_id":"","url":"https://api.github.com/users/LeticiaTran","html_url":"https://github.com/LeticiaTran","followers_url":"https://api.github.com/users/LeticiaTran/followers","following_url":"https://api.github.com/users/LeticiaTran/following{/other_user}","gists_url":"https://api.github.com/users/LeticiaTran/gists{/gist_id}","starred_url":"https://api.github.com/users/LeticiaTran/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LeticiaTran/subscriptions","organizations_url":"https://api.github.com/users/LeticiaTran/orgs","repos_url":"https://api.github.com/users/LeticiaTran/repos","events_url":"https://api.github.com/users/LeticiaTran/events{/privacy}","received_events_url":"https://api.github.com/users/LeticiaTran/received_events","type":"User","site_admin":false},"repo":{"id":121566767,"name":"grocery-store","full_name":"LeticiaTran/grocery-store","owner":{"login":"LeticiaTran","id":29556476,"avatar_url":"https://avatars1.githubusercontent.com/u/29556476?v=4","gravatar_id":"","url":"https://api.github.com/users/LeticiaTran","html_url":"https://github.com/LeticiaTran","followers_url":"https://api.github.com/users/LeticiaTran/followers","following_url":"https://api.github.com/users/LeticiaTran/following{/other_user}","gists_url":"https://api.github.com/users/LeticiaTran/gists{/gist_id}","starred_url":"https://api.github.com/users/LeticiaTran/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LeticiaTran/subscriptions","organizations_url":"https://api.github.com/users/LeticiaTran/orgs","repos_url":"https://api.github.com/users/LeticiaTran/repos","events_url":"https://api.github.com/users/LeticiaTran/events{/privacy}","received_events_url":"https://api.github.com/users/LeticiaTran/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/LeticiaTran/grocery-store","description":null,"fork":true,"url":"https://api.github.com/repos/LeticiaTran/grocery-store","forks_url":"https://api.github.com/repos/LeticiaTran/grocery-store/forks","keys_url":"https://api.github.com/repos/LeticiaTran/grocery-store/keys{/key_id}","collaborators_url":"https://api.github.com/repos/LeticiaTran/grocery-store/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/LeticiaTran/grocery-store/teams","hooks_url":"https://api.github.com/repos/LeticiaTran/grocery-store/hooks","issue_events_url":"https://api.github.com/repos/LeticiaTran/grocery-store/issues/events{/number}","events_url":"https://api.github.com/repos/LeticiaTran/grocery-store/events","assignees_url":"https://api.github.com/repos/LeticiaTran/grocery-store/assignees{/user}","branches_url":"https://api.github.com/repos/LeticiaTran/grocery-store/branches{/branch}","tags_url":"https://api.github.com/repos/LeticiaTran/grocery-store/tags","blobs_url":"https://api.github.com/repos/LeticiaTran/grocery-store/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/LeticiaTran/grocery-store/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/LeticiaTran/grocery-store/git/refs{/sha}","trees_url":"https://api.github.com/repos/LeticiaTran/grocery-store/git/trees{/sha}","statuses_url":"https://api.github.com/repos/LeticiaTran/grocery-store/statuses/{sha}","languages_url":"https://api.github.com/repos/LeticiaTran/grocery-store/languages","stargazers_url":"https://api.github.com/repos/LeticiaTran/grocery-store/stargazers","contributors_url":"https://api.github.com/repos/LeticiaTran/grocery-store/contributors","subscribers_url":"https://api.github.com/repos/LeticiaTran/grocery-store/subscribers","subscription_url":"https://api.github.com/repos/LeticiaTran/grocery-store/subscription","commits_url":"https://api.github.com/repos/LeticiaTran/grocery-store/commits{/sha}","git_commits_url":"https://api.github.com/repos/LeticiaTran/grocery-store/git/commits{/sha}","comments_url":"https://api.github.com/repos/LeticiaTran/grocery-store/comments{/number}","issue_comment_url":"https://api.github.com/repos/LeticiaTran/grocery-store/issues/comments{/number}","contents_url":"https://api.github.com/repos/LeticiaTran/grocery-store/contents/{+path}","compare_url":"https://api.github.com/repos/LeticiaTran/grocery-store/compare/{base}...{head}","merges_url":"https://api.github.com/repos/LeticiaTran/grocery-store/merges","archive_url":"https://api.github.com/repos/LeticiaTran/grocery-store/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/LeticiaTran/grocery-store/downloads","issues_url":"https://api.github.com/repos/LeticiaTran/grocery-store/issues{/number}","pulls_url":"https://api.github.com/repos/LeticiaTran/grocery-store/pulls{/number}","milestones_url":"https://api.github.com/repos/LeticiaTran/grocery-store/milestones{/number}","notifications_url":"https://api.github.com/repos/LeticiaTran/grocery-store/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/LeticiaTran/grocery-store/labels{/name}","releases_url":"https://api.github.com/repos/LeticiaTran/grocery-store/releases{/id}","deployments_url":"https://api.github.com/repos/LeticiaTran/grocery-store/deployments","created_at":"2018-02-14T22:05:31Z","updated_at":"2018-02-14T22:05:34Z","pushed_at":"2018-02-20T17:04:09Z","git_url":"git://github.com/LeticiaTran/grocery-store.git","ssh_url":"git@github.com:LeticiaTran/grocery-store.git","clone_url":"https://github.com/LeticiaTran/grocery-store.git","svn_url":"https://github.com/LeticiaTran/grocery-store","homepage":null,"size":87,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"Ada-C9:master","ref":"master","sha":"8fe9ef579bdd0d336e4ba602198492670dd79972","user":{"login":"Ada-C9","id":35278806,"avatar_url":"https://avatars0.githubusercontent.com/u/35278806?v=4","gravatar_id":"","url":"https://api.github.com/users/Ada-C9","html_url":"https://github.com/Ada-C9","followers_url":"https://api.github.com/users/Ada-C9/followers","following_url":"https://api.github.com/users/Ada-C9/following{/other_user}","gists_url":"https://api.github.com/users/Ada-C9/gists{/gist_id}","starred_url":"https://api.github.com/users/Ada-C9/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ada-C9/subscriptions","organizations_url":"https://api.github.com/users/Ada-C9/orgs","repos_url":"https://api.github.com/users/Ada-C9/repos","events_url":"https://api.github.com/users/Ada-C9/events{/privacy}","received_events_url":"https://api.github.com/users/Ada-C9/received_events","type":"Organization","site_admin":false},"repo":{"id":120687607,"name":"grocery-store","full_name":"Ada-C9/grocery-store","owner":{"login":"Ada-C9","id":35278806,"avatar_url":"https://avatars0.githubusercontent.com/u/35278806?v=4","gravatar_id":"","url":"https://api.github.com/users/Ada-C9","html_url":"https://github.com/Ada-C9","followers_url":"https://api.github.com/users/Ada-C9/followers","following_url":"https://api.github.com/users/Ada-C9/following{/other_user}","gists_url":"https://api.github.com/users/Ada-C9/gists{/gist_id}","starred_url":"https://api.github.com/users/Ada-C9/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ada-C9/subscriptions","organizations_url":"https://api.github.com/users/Ada-C9/orgs","repos_url":"https://api.github.com/users/Ada-C9/repos","events_url":"https://api.github.com/users/Ada-C9/events{/privacy}","received_events_url":"https://api.github.com/users/Ada-C9/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Ada-C9/grocery-store","description":null,"fork":true,"url":"https://api.github.com/repos/Ada-C9/grocery-store","forks_url":"https://api.github.com/repos/Ada-C9/grocery-store/forks","keys_url":"https://api.github.com/repos/Ada-C9/grocery-store/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Ada-C9/grocery-store/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Ada-C9/grocery-store/teams","hooks_url":"https://api.github.com/repos/Ada-C9/grocery-store/hooks","issue_events_url":"https://api.github.com/repos/Ada-C9/grocery-store/issues/events{/number}","events_url":"https://api.github.com/repos/Ada-C9/grocery-store/events","assignees_url":"https://api.github.com/repos/Ada-C9/grocery-store/assignees{/user}","branches_url":"https://api.github.com/repos/Ada-C9/grocery-store/branches{/branch}","tags_url":"https://api.github.com/repos/Ada-C9/grocery-store/tags","blobs_url":"https://api.github.com/repos/Ada-C9/grocery-store/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Ada-C9/grocery-store/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Ada-C9/grocery-store/git/refs{/sha}","trees_url":"https://api.github.com/repos/Ada-C9/grocery-store/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Ada-C9/grocery-store/statuses/{sha}","languages_url":"https://api.github.com/repos/Ada-C9/grocery-store/languages","stargazers_url":"https://api.github.com/repos/Ada-C9/grocery-store/stargazers","contributors_url":"https://api.github.com/repos/Ada-C9/grocery-store/contributors","subscribers_url":"https://api.github.com/repos/Ada-C9/grocery-store/subscribers","subscription_url":"https://api.github.com/repos/Ada-C9/grocery-store/subscription","commits_url":"https://api.github.com/repos/Ada-C9/grocery-store/commits{/sha}","git_commits_url":"https://api.github.com/repos/Ada-C9/grocery-store/git/commits{/sha}","comments_url":"https://api.github.com/repos/Ada-C9/grocery-store/comments{/number}","issue_comment_url":"https://api.github.com/repos/Ada-C9/grocery-store/issues/comments{/number}","contents_url":"https://api.github.com/repos/Ada-C9/grocery-store/contents/{+path}","compare_url":"https://api.github.com/repos/Ada-C9/grocery-store/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Ada-C9/grocery-store/merges","archive_url":"https://api.github.com/repos/Ada-C9/grocery-store/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Ada-C9/grocery-store/downloads","issues_url":"https://api.github.com/repos/Ada-C9/grocery-store/issues{/number}","pulls_url":"https://api.github.com/repos/Ada-C9/grocery-store/pulls{/number}","milestones_url":"https://api.github.com/repos/Ada-C9/grocery-store/milestones{/number}","notifications_url":"https://api.github.com/repos/Ada-C9/grocery-store/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Ada-C9/grocery-store/labels{/name}","releases_url":"https://api.github.com/repos/Ada-C9/grocery-store/releases{/id}","deployments_url":"https://api.github.com/repos/Ada-C9/grocery-store/deployments","created_at":"2018-02-08T00:02:36Z","updated_at":"2018-02-08T00:02:38Z","pushed_at":"2018-02-23T01:50:06Z","git_url":"git://github.com/Ada-C9/grocery-store.git","ssh_url":"git@github.com:Ada-C9/grocery-store.git","clone_url":"https://github.com/Ada-C9/grocery-store.git","svn_url":"https://github.com/Ada-C9/grocery-store","homepage":null,"size":42,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":50,"mirror_url":null,"archived":false,"open_issues_count":45,"license":null,"forks":50,"open_issues":45,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Ada-C9/grocery-store/pulls/20"},"html":{"href":"https://github.com/Ada-C9/grocery-store/pull/20"},"issue":{"href":"https://api.github.com/repos/Ada-C9/grocery-store/issues/20"},"comments":{"href":"https://api.github.com/repos/Ada-C9/grocery-store/issues/20/comments"},"review_comments":{"href":"https://api.github.com/repos/Ada-C9/grocery-store/pulls/20/comments"},"review_comment":{"href":"https://api.github.com/repos/Ada-C9/grocery-store/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Ada-C9/grocery-store/pulls/20/commits"},"statuses":{"href":"https://api.github.com/repos/Ada-C9/grocery-store/statuses/84ad76e220cf1fbc372187b1b938ddf61a154f57"}},"author_association":"NONE"}}
{"actor":{"display_login":"CheezItMan"}}