{"action":"created","comment":{"url":"https://api.github.com/repos/Ada-C10/grocery-store/pulls/comments/214787207","pull_request_review_id":151911673,"id":214787207,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxNDc4NzIwNw==","diff_hunk":"@@ -0,0 +1,97 @@\n+# allows use of csv file\n+require 'csv'\n+# allows access to customer.rb\n+require_relative 'customer'\n+\n+# creates Order class\n+class Order\n+  # reads data from orders.csv file\n+  @@order = CSV.read(\"data/orders.csv\")\n+\n+  # id attribute is read only\n+  attr_reader :id\n+  # other attributes can be read and written\n+  attr_accessor :products, :customer, :fulfillment_status\n+\n+  # accepts 4 attributes with default status being :pending\n+  def initialize(id, products, customer, fulfillment_status = :pending)\n+    @id = id.to_i\n+    @products = products\n+    @customer = customer\n+    @fulfillment_status = fulfillment_status\n+      # if status doesn't match any of the following\n+      # it will raise ArgumentError\n+      if fulfillment_status != :pending &&\n+        fulfillment_status != :paid &&\n+        fulfillment_status != :processing &&\n+        fulfillment_status != :shipped &&\n+        fulfillment_status != :complete\n+        raise ArgumentError","path":"lib/order.rb","position":29,"original_position":29,"commit_id":"7dcb8492b865097894c866269ad94b6b930511ac","original_commit_id":"7dcb8492b865097894c866269ad94b6b930511ac","user":{"login":"tildeee","id":30602862,"node_id":"MDQ6VXNlcjMwNjAyODYy","avatar_url":"https://avatars0.githubusercontent.com/u/30602862?v=4","gravatar_id":"","url":"https://api.github.com/users/tildeee","html_url":"https://github.com/tildeee","followers_url":"https://api.github.com/users/tildeee/followers","following_url":"https://api.github.com/users/tildeee/following{/other_user}","gists_url":"https://api.github.com/users/tildeee/gists{/gist_id}","starred_url":"https://api.github.com/users/tildeee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tildeee/subscriptions","organizations_url":"https://api.github.com/users/tildeee/orgs","repos_url":"https://api.github.com/users/tildeee/repos","events_url":"https://api.github.com/users/tildeee/events{/privacy}","received_events_url":"https://api.github.com/users/tildeee/received_events","type":"User","site_admin":false},"body":"Nice! Maybe there's a different way to see if the value of `fulfillment_status` is one of many different options rather than checking if it's equal to several different options?","created_at":"2018-09-04T05:03:35Z","updated_at":"2018-09-04T05:03:35Z","html_url":"https://github.com/Ada-C10/grocery-store/pull/16#discussion_r214787207","pull_request_url":"https://api.github.com/repos/Ada-C10/grocery-store/pulls/16","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/Ada-C10/grocery-store/pulls/comments/214787207"},"html":{"href":"https://github.com/Ada-C10/grocery-store/pull/16#discussion_r214787207"},"pull_request":{"href":"https://api.github.com/repos/Ada-C10/grocery-store/pulls/16"}}},"pull_request":{"url":"https://api.github.com/repos/Ada-C10/grocery-store/pulls/16","id":210976965,"node_id":"MDExOlB1bGxSZXF1ZXN0MjEwOTc2OTY1","html_url":"https://github.com/Ada-C10/grocery-store/pull/16","diff_url":"https://github.com/Ada-C10/grocery-store/pull/16.diff","patch_url":"https://github.com/Ada-C10/grocery-store/pull/16.patch","issue_url":"https://api.github.com/repos/Ada-C10/grocery-store/issues/16","number":16,"state":"open","locked":false,"title":"Karis - Edges - Grocery Store","user":{"login":"kimj42","id":17921445,"node_id":"MDQ6VXNlcjE3OTIxNDQ1","avatar_url":"https://avatars3.githubusercontent.com/u/17921445?v=4","gravatar_id":"","url":"https://api.github.com/users/kimj42","html_url":"https://github.com/kimj42","followers_url":"https://api.github.com/users/kimj42/followers","following_url":"https://api.github.com/users/kimj42/following{/other_user}","gists_url":"https://api.github.com/users/kimj42/gists{/gist_id}","starred_url":"https://api.github.com/users/kimj42/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kimj42/subscriptions","organizations_url":"https://api.github.com/users/kimj42/orgs","repos_url":"https://api.github.com/users/kimj42/repos","events_url":"https://api.github.com/users/kimj42/events{/privacy}","received_events_url":"https://api.github.com/users/kimj42/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\nQuestion | Response\r\n--- | ---\r\nWhat is accomplished with `raise ArgumentError`? | It let's the user know that there is an argument error and tells the user where to look to fix that error.\r\nWhy do you think we made the `.all` & `.find` methods class methods?  Why not instance methods? | I believe the reason why it's a class methods instead of an instance method is because a class method allows you to look at all of the instances created by that class while an instance method will only allow you to look at one instance.\r\nThink about the relation between `Order` and `Customer`. Is this relation one-to-one, one-to-many, or something else? How does that compare to the Solar System project? | The relation of 'Customer' and 'Order' is one-to-many. One customer ordered many things so has many order ids. The solar system project had one solar system and many planets so it's one-to-many. \r\nHow is the relation between `Order` and `Customer` tracked in the CSV file? How is it tracked in your program? Why might these be different? | It's tracked by using require_relative method. 'Order' has to keep track of 'Customer' because it has to create an instance of the Customer class for it's customer_id. This is different for 'Customer' because that class doesn't need to access data from 'Order' in its code. \r\nDid the presence of automated tests change the way you thought about the problem? How? | Yes. It made me change what kind of data structure I should use and gave me hints as to whether the variable should be symbol, string, or a float.\r\nCS Fun: If there are `C` customers listed in `customers.csv` and `R` orders listed in `orders.csv`, what is the time complexity of calling `Customer.find`? What is the time complexity of `Order.find`? | The time complexity of calling Customer.find would be O(n). The time complexity of 'Order.find' would be Quadratic.","created_at":"2018-08-26T23:24:51Z","updated_at":"2018-09-04T05:03:35Z","closed_at":null,"merged_at":null,"merge_commit_sha":"db73e790396a658296b3654faf420233bb8992ac","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/Ada-C10/grocery-store/pulls/16/commits","review_comments_url":"https://api.github.com/repos/Ada-C10/grocery-store/pulls/16/comments","review_comment_url":"https://api.github.com/repos/Ada-C10/grocery-store/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Ada-C10/grocery-store/issues/16/comments","statuses_url":"https://api.github.com/repos/Ada-C10/grocery-store/statuses/7dcb8492b865097894c866269ad94b6b930511ac","head":{"label":"kimj42:master","ref":"master","sha":"7dcb8492b865097894c866269ad94b6b930511ac","user":{"login":"kimj42","id":17921445,"node_id":"MDQ6VXNlcjE3OTIxNDQ1","avatar_url":"https://avatars3.githubusercontent.com/u/17921445?v=4","gravatar_id":"","url":"https://api.github.com/users/kimj42","html_url":"https://github.com/kimj42","followers_url":"https://api.github.com/users/kimj42/followers","following_url":"https://api.github.com/users/kimj42/following{/other_user}","gists_url":"https://api.github.com/users/kimj42/gists{/gist_id}","starred_url":"https://api.github.com/users/kimj42/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kimj42/subscriptions","organizations_url":"https://api.github.com/users/kimj42/orgs","repos_url":"https://api.github.com/users/kimj42/repos","events_url":"https://api.github.com/users/kimj42/events{/privacy}","received_events_url":"https://api.github.com/users/kimj42/received_events","type":"User","site_admin":false},"repo":{"id":145896145,"node_id":"MDEwOlJlcG9zaXRvcnkxNDU4OTYxNDU=","name":"grocery-store","full_name":"kimj42/grocery-store","owner":{"login":"kimj42","id":17921445,"node_id":"MDQ6VXNlcjE3OTIxNDQ1","avatar_url":"https://avatars3.githubusercontent.com/u/17921445?v=4","gravatar_id":"","url":"https://api.github.com/users/kimj42","html_url":"https://github.com/kimj42","followers_url":"https://api.github.com/users/kimj42/followers","following_url":"https://api.github.com/users/kimj42/following{/other_user}","gists_url":"https://api.github.com/users/kimj42/gists{/gist_id}","starred_url":"https://api.github.com/users/kimj42/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kimj42/subscriptions","organizations_url":"https://api.github.com/users/kimj42/orgs","repos_url":"https://api.github.com/users/kimj42/repos","events_url":"https://api.github.com/users/kimj42/events{/privacy}","received_events_url":"https://api.github.com/users/kimj42/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/kimj42/grocery-store","description":null,"fork":true,"url":"https://api.github.com/repos/kimj42/grocery-store","forks_url":"https://api.github.com/repos/kimj42/grocery-store/forks","keys_url":"https://api.github.com/repos/kimj42/grocery-store/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kimj42/grocery-store/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kimj42/grocery-store/teams","hooks_url":"https://api.github.com/repos/kimj42/grocery-store/hooks","issue_events_url":"https://api.github.com/repos/kimj42/grocery-store/issues/events{/number}","events_url":"https://api.github.com/repos/kimj42/grocery-store/events","assignees_url":"https://api.github.com/repos/kimj42/grocery-store/assignees{/user}","branches_url":"https://api.github.com/repos/kimj42/grocery-store/branches{/branch}","tags_url":"https://api.github.com/repos/kimj42/grocery-store/tags","blobs_url":"https://api.github.com/repos/kimj42/grocery-store/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kimj42/grocery-store/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kimj42/grocery-store/git/refs{/sha}","trees_url":"https://api.github.com/repos/kimj42/grocery-store/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kimj42/grocery-store/statuses/{sha}","languages_url":"https://api.github.com/repos/kimj42/grocery-store/languages","stargazers_url":"https://api.github.com/repos/kimj42/grocery-store/stargazers","contributors_url":"https://api.github.com/repos/kimj42/grocery-store/contributors","subscribers_url":"https://api.github.com/repos/kimj42/grocery-store/subscribers","subscription_url":"https://api.github.com/repos/kimj42/grocery-store/subscription","commits_url":"https://api.github.com/repos/kimj42/grocery-store/commits{/sha}","git_commits_url":"https://api.github.com/repos/kimj42/grocery-store/git/commits{/sha}","comments_url":"https://api.github.com/repos/kimj42/grocery-store/comments{/number}","issue_comment_url":"https://api.github.com/repos/kimj42/grocery-store/issues/comments{/number}","contents_url":"https://api.github.com/repos/kimj42/grocery-store/contents/{+path}","compare_url":"https://api.github.com/repos/kimj42/grocery-store/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kimj42/grocery-store/merges","archive_url":"https://api.github.com/repos/kimj42/grocery-store/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kimj42/grocery-store/downloads","issues_url":"https://api.github.com/repos/kimj42/grocery-store/issues{/number}","pulls_url":"https://api.github.com/repos/kimj42/grocery-store/pulls{/number}","milestones_url":"https://api.github.com/repos/kimj42/grocery-store/milestones{/number}","notifications_url":"https://api.github.com/repos/kimj42/grocery-store/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kimj42/grocery-store/labels{/name}","releases_url":"https://api.github.com/repos/kimj42/grocery-store/releases{/id}","deployments_url":"https://api.github.com/repos/kimj42/grocery-store/deployments","created_at":"2018-08-23T19:07:47Z","updated_at":"2018-08-26T23:05:55Z","pushed_at":"2018-08-26T23:05:54Z","git_url":"git://github.com/kimj42/grocery-store.git","ssh_url":"git@github.com:kimj42/grocery-store.git","clone_url":"https://github.com/kimj42/grocery-store.git","svn_url":"https://github.com/kimj42/grocery-store","homepage":null,"size":57,"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-C10:master","ref":"master","sha":"541d8d762593f9b919f3b005e79410d6602148a3","user":{"login":"Ada-C10","id":40303054,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQwMzAzMDU0","avatar_url":"https://avatars0.githubusercontent.com/u/40303054?v=4","gravatar_id":"","url":"https://api.github.com/users/Ada-C10","html_url":"https://github.com/Ada-C10","followers_url":"https://api.github.com/users/Ada-C10/followers","following_url":"https://api.github.com/users/Ada-C10/following{/other_user}","gists_url":"https://api.github.com/users/Ada-C10/gists{/gist_id}","starred_url":"https://api.github.com/users/Ada-C10/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ada-C10/subscriptions","organizations_url":"https://api.github.com/users/Ada-C10/orgs","repos_url":"https://api.github.com/users/Ada-C10/repos","events_url":"https://api.github.com/users/Ada-C10/events{/privacy}","received_events_url":"https://api.github.com/users/Ada-C10/received_events","type":"Organization","site_admin":false},"repo":{"id":145623240,"node_id":"MDEwOlJlcG9zaXRvcnkxNDU2MjMyNDA=","name":"grocery-store","full_name":"Ada-C10/grocery-store","owner":{"login":"Ada-C10","id":40303054,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQwMzAzMDU0","avatar_url":"https://avatars0.githubusercontent.com/u/40303054?v=4","gravatar_id":"","url":"https://api.github.com/users/Ada-C10","html_url":"https://github.com/Ada-C10","followers_url":"https://api.github.com/users/Ada-C10/followers","following_url":"https://api.github.com/users/Ada-C10/following{/other_user}","gists_url":"https://api.github.com/users/Ada-C10/gists{/gist_id}","starred_url":"https://api.github.com/users/Ada-C10/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ada-C10/subscriptions","organizations_url":"https://api.github.com/users/Ada-C10/orgs","repos_url":"https://api.github.com/users/Ada-C10/repos","events_url":"https://api.github.com/users/Ada-C10/events{/privacy}","received_events_url":"https://api.github.com/users/Ada-C10/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Ada-C10/grocery-store","description":null,"fork":true,"url":"https://api.github.com/repos/Ada-C10/grocery-store","forks_url":"https://api.github.com/repos/Ada-C10/grocery-store/forks","keys_url":"https://api.github.com/repos/Ada-C10/grocery-store/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Ada-C10/grocery-store/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Ada-C10/grocery-store/teams","hooks_url":"https://api.github.com/repos/Ada-C10/grocery-store/hooks","issue_events_url":"https://api.github.com/repos/Ada-C10/grocery-store/issues/events{/number}","events_url":"https://api.github.com/repos/Ada-C10/grocery-store/events","assignees_url":"https://api.github.com/repos/Ada-C10/grocery-store/assignees{/user}","branches_url":"https://api.github.com/repos/Ada-C10/grocery-store/branches{/branch}","tags_url":"https://api.github.com/repos/Ada-C10/grocery-store/tags","blobs_url":"https://api.github.com/repos/Ada-C10/grocery-store/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Ada-C10/grocery-store/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Ada-C10/grocery-store/git/refs{/sha}","trees_url":"https://api.github.com/repos/Ada-C10/grocery-store/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Ada-C10/grocery-store/statuses/{sha}","languages_url":"https://api.github.com/repos/Ada-C10/grocery-store/languages","stargazers_url":"https://api.github.com/repos/Ada-C10/grocery-store/stargazers","contributors_url":"https://api.github.com/repos/Ada-C10/grocery-store/contributors","subscribers_url":"https://api.github.com/repos/Ada-C10/grocery-store/subscribers","subscription_url":"https://api.github.com/repos/Ada-C10/grocery-store/subscription","commits_url":"https://api.github.com/repos/Ada-C10/grocery-store/commits{/sha}","git_commits_url":"https://api.github.com/repos/Ada-C10/grocery-store/git/commits{/sha}","comments_url":"https://api.github.com/repos/Ada-C10/grocery-store/comments{/number}","issue_comment_url":"https://api.github.com/repos/Ada-C10/grocery-store/issues/comments{/number}","contents_url":"https://api.github.com/repos/Ada-C10/grocery-store/contents/{+path}","compare_url":"https://api.github.com/repos/Ada-C10/grocery-store/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Ada-C10/grocery-store/merges","archive_url":"https://api.github.com/repos/Ada-C10/grocery-store/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Ada-C10/grocery-store/downloads","issues_url":"https://api.github.com/repos/Ada-C10/grocery-store/issues{/number}","pulls_url":"https://api.github.com/repos/Ada-C10/grocery-store/pulls{/number}","milestones_url":"https://api.github.com/repos/Ada-C10/grocery-store/milestones{/number}","notifications_url":"https://api.github.com/repos/Ada-C10/grocery-store/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Ada-C10/grocery-store/labels{/name}","releases_url":"https://api.github.com/repos/Ada-C10/grocery-store/releases{/id}","deployments_url":"https://api.github.com/repos/Ada-C10/grocery-store/deployments","created_at":"2018-08-21T21:51:10Z","updated_at":"2018-08-31T17:34:46Z","pushed_at":"2018-09-03T00:38:24Z","git_url":"git://github.com/Ada-C10/grocery-store.git","ssh_url":"git@github.com:Ada-C10/grocery-store.git","clone_url":"https://github.com/Ada-C10/grocery-store.git","svn_url":"https://github.com/Ada-C10/grocery-store","homepage":null,"size":51,"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":48,"mirror_url":null,"archived":false,"open_issues_count":48,"license":null,"forks":48,"open_issues":48,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Ada-C10/grocery-store/pulls/16"},"html":{"href":"https://github.com/Ada-C10/grocery-store/pull/16"},"issue":{"href":"https://api.github.com/repos/Ada-C10/grocery-store/issues/16"},"comments":{"href":"https://api.github.com/repos/Ada-C10/grocery-store/issues/16/comments"},"review_comments":{"href":"https://api.github.com/repos/Ada-C10/grocery-store/pulls/16/comments"},"review_comment":{"href":"https://api.github.com/repos/Ada-C10/grocery-store/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Ada-C10/grocery-store/pulls/16/commits"},"statuses":{"href":"https://api.github.com/repos/Ada-C10/grocery-store/statuses/7dcb8492b865097894c866269ad94b6b930511ac"}},"author_association":"NONE"}}
{"actor":{"display_login":"tildeee"}}