payload: {"action":"created","comment":{"url":"https://api.github.com/repos/Ada-C12/solar-system/pulls/comments/319326700","pull_request_review_id":281790318,"id":319326700,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDMxOTMyNjcwMA==","diff_hunk":"@@ -0,0 +1,79 @@\n+require_relative 'lib/planet'\n+require_relative 'lib/solar_system'\n+\n+def main\n+\n+    # Wave 3\n+    # ==========================================\n+    # Restructure main to do the following:\n+\n+    #   Create a SolarSystem and add some Planets\n+    solar_system = SolarSystem.new('Sol')\n+\n+    mercury = Planet.new('Mercury', 'red', 6.8794, 7.33, 'is far')\n+    venus = Planet.new('venus', 'grey', 6.6565, 9.33, 'is beatiful')\n+    earth = Planet.new('Earth', 'green', 5.972e24, 5.5, 'Only planet known to support life')\n+    mars = Planet.new('Mars', 'pink', 5.972e24, 5.5, 'Only planet known to support life')\n+    jupiter = Planet.new('Jupiter', 'blue', 5.972e24, 5.5, 'Only planet known to support life')\n+\n+    # add planets to the solar system\n+    solar_system.add_planet(mercury)\n+    solar_system.add_planet(venus)\n+    solar_system.add_planet(earth)\n+    solar_system.add_planet(mars)\n+    solar_system.add_planet(jupiter)\n+\n+    #   Enter a control loop that repeatedly asks the user what to do next. \n+    #   The two options at this point are list planets and exit.\n+\n+    loop do\n+      puts \"\\nSelect one of the choices from below: \"\n+      print \"Type 1 to list planets, 2 to view planet details, 3 to add planet and 4 to exit: \"\n+\n+      user_input = gets.chomp.to_i\n+      \n+      if user_input == 4\n+        break\n+      elsif user_input == 1\n+        list = solar_system.list_planets()\n+        puts list\n+      elsif user_input == 2\n+        planet_details(solar_system)\n+      elsif user_input == 3\n+        add_planet(solar_system)\n+\n+      end\n+\n+    end\n+     \n+  end\n+\n+\n+  def planet_details(solar_system)\n+    print \"Enter the name of the planet you want to learn about: \"\n+    planet_name = gets.chomp\n+    planet = solar_system.find_planet_by_name(planet_name)\n+    puts planet.summary","path":"main.rb","position":56,"original_position":56,"commit_id":"5e4791e31d423eb8e23692f105cfc2a46187b668","original_commit_id":"5e4791e31d423eb8e23692f105cfc2a46187b668","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":"If the program asks me `\"Enter the name of the planet you want to learn about: \"` and I put in `9banana`, then we run `planet = solar_system.find_planet_by_name(planet_name)`... in this case, then `planet` has the value of the string `\"No planet with the 9banana in this solar system!\"` (which is what the method returns if no planet was found). Then, in this above line, we call `.summary` on `planet`... Which then breaks the program with a `NoMethodError`.\r\n\r\nIdeally, we would change the `main` method so that the line `planet.summary` wouldn't run if we didn't find a matching `Planet`","created_at":"2019-08-30T01:12:23Z","updated_at":"2019-08-30T01:12:23Z","html_url":"https://github.com/Ada-C12/solar-system/pull/14#discussion_r319326700","pull_request_url":"https://api.github.com/repos/Ada-C12/solar-system/pulls/14","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/Ada-C12/solar-system/pulls/comments/319326700"},"html":{"href":"https://github.com/Ada-C12/solar-system/pull/14#discussion_r319326700"},"pull_request":{"href":"https://api.github.com/repos/Ada-C12/solar-system/pulls/14"}}},"pull_request":{"url":"https://api.github.com/repos/Ada-C12/solar-system/pulls/14","id":309314993,"node_id":"MDExOlB1bGxSZXF1ZXN0MzA5MzE0OTkz","html_url":"https://github.com/Ada-C12/solar-system/pull/14","diff_url":"https://github.com/Ada-C12/solar-system/pull/14.diff","patch_url":"https://github.com/Ada-C12/solar-system/pull/14.patch","issue_url":"https://api.github.com/repos/Ada-C12/solar-system/issues/14","number":14,"state":"open","locked":false,"title":"Solar System done","user":{"login":"sarashahbaig","id":37054356,"node_id":"MDQ6VXNlcjM3MDU0MzU2","avatar_url":"https://avatars0.githubusercontent.com/u/37054356?v=4","gravatar_id":"","url":"https://api.github.com/users/sarashahbaig","html_url":"https://github.com/sarashahbaig","followers_url":"https://api.github.com/users/sarashahbaig/followers","following_url":"https://api.github.com/users/sarashahbaig/following{/other_user}","gists_url":"https://api.github.com/users/sarashahbaig/gists{/gist_id}","starred_url":"https://api.github.com/users/sarashahbaig/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sarashahbaig/subscriptions","organizations_url":"https://api.github.com/users/sarashahbaig/orgs","repos_url":"https://api.github.com/users/sarashahbaig/repos","events_url":"https://api.github.com/users/sarashahbaig/events{/privacy}","received_events_url":"https://api.github.com/users/sarashahbaig/received_events","type":"User","site_admin":false},"body":"# Solar System\r\nCongratulations! You're submitting your assignment.\r\n\r\n## Comprehension Questions\r\n\r\n|  Question \t|  Answer\r\n|---\t|---\t|\r\n| When does the `initialize` method run? What does it do? | The `initalize` method runs when an instance of a class is created. That is, when we use the `.new` with a class to create an instance. The job of the `initialize` method is to create an instance of a class. \r\n| Why do you imagine we made our instance variables readable but not writable? | Because we want instance variables not to be modified by the user.\r\n| How would your program be different if each planet was stored as a `Hash` instead of an instance of a class? | The program will have more code as we would write the keys for each hash. Secondly, we would not be able to do any validation, such for the mass not being a negative value. Third, we would not have custom methods to call on each single hash.\r\n| How would your program be different if your `SolarSystem` class used a `Hash` instead of an `Array` to store the list of planets? | We would have to provide keys for each single planet. Secondly, we would not be able to call methods on those planets as we had defined in the `Planet` class.\r\n| There is a software design principle called the SRP. The Single Responsibility Principle (SRP) says that each class should be responsible for exactly one thing. Do your classes follow SRP? What responsibilities do they have? | Yes, these two classes follow the SRP software design principle. The `Planet` class is responsible for how to create an instance of the same class and then also responsible for providing summary details for the same instance. The `SolarSystem` class is responsible for how an instance of the same class is created along with other functionality that belong to a solar system.\r\n| How did you organize your `require` statements? Which files needed `require`s, and which did not? What is the pattern? | I used `require_relative` to include the `planet` and `solar system` files in the `main.rb` file. Only `main.rb` need `require`. It appears that `require` is used to include class files whenever we want to create an instance of those classes.","created_at":"2019-08-21T04:10:37Z","updated_at":"2019-08-30T01:12:23Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4cc20f05d6ce0d201566c546b360609e31106d3c","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/Ada-C12/solar-system/pulls/14/commits","review_comments_url":"https://api.github.com/repos/Ada-C12/solar-system/pulls/14/comments","review_comment_url":"https://api.github.com/repos/Ada-C12/solar-system/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Ada-C12/solar-system/issues/14/comments","statuses_url":"https://api.github.com/repos/Ada-C12/solar-system/statuses/5e4791e31d423eb8e23692f105cfc2a46187b668","head":{"label":"sarashahbaig:master","ref":"master","sha":"5e4791e31d423eb8e23692f105cfc2a46187b668","user":{"login":"sarashahbaig","id":37054356,"node_id":"MDQ6VXNlcjM3MDU0MzU2","avatar_url":"https://avatars0.githubusercontent.com/u/37054356?v=4","gravatar_id":"","url":"https://api.github.com/users/sarashahbaig","html_url":"https://github.com/sarashahbaig","followers_url":"https://api.github.com/users/sarashahbaig/followers","following_url":"https://api.github.com/users/sarashahbaig/following{/other_user}","gists_url":"https://api.github.com/users/sarashahbaig/gists{/gist_id}","starred_url":"https://api.github.com/users/sarashahbaig/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sarashahbaig/subscriptions","organizations_url":"https://api.github.com/users/sarashahbaig/orgs","repos_url":"https://api.github.com/users/sarashahbaig/repos","events_url":"https://api.github.com/users/sarashahbaig/events{/privacy}","received_events_url":"https://api.github.com/users/sarashahbaig/received_events","type":"User","site_admin":false},"repo":{"id":203253391,"node_id":"MDEwOlJlcG9zaXRvcnkyMDMyNTMzOTE=","name":"solar-system","full_name":"sarashahbaig/solar-system","private":false,"owner":{"login":"sarashahbaig","id":37054356,"node_id":"MDQ6VXNlcjM3MDU0MzU2","avatar_url":"https://avatars0.githubusercontent.com/u/37054356?v=4","gravatar_id":"","url":"https://api.github.com/users/sarashahbaig","html_url":"https://github.com/sarashahbaig","followers_url":"https://api.github.com/users/sarashahbaig/followers","following_url":"https://api.github.com/users/sarashahbaig/following{/other_user}","gists_url":"https://api.github.com/users/sarashahbaig/gists{/gist_id}","starred_url":"https://api.github.com/users/sarashahbaig/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sarashahbaig/subscriptions","organizations_url":"https://api.github.com/users/sarashahbaig/orgs","repos_url":"https://api.github.com/users/sarashahbaig/repos","events_url":"https://api.github.com/users/sarashahbaig/events{/privacy}","received_events_url":"https://api.github.com/users/sarashahbaig/received_events","type":"User","site_admin":false},"html_url":"https://github.com/sarashahbaig/solar-system","description":"Project: Create a CLI program that interacts with one Solar System and many Planets using OO principles","fork":true,"url":"https://api.github.com/repos/sarashahbaig/solar-system","forks_url":"https://api.github.com/repos/sarashahbaig/solar-system/forks","keys_url":"https://api.github.com/repos/sarashahbaig/solar-system/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sarashahbaig/solar-system/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sarashahbaig/solar-system/teams","hooks_url":"https://api.github.com/repos/sarashahbaig/solar-system/hooks","issue_events_url":"https://api.github.com/repos/sarashahbaig/solar-system/issues/events{/number}","events_url":"https://api.github.com/repos/sarashahbaig/solar-system/events","assignees_url":"https://api.github.com/repos/sarashahbaig/solar-system/assignees{/user}","branches_url":"https://api.github.com/repos/sarashahbaig/solar-system/branches{/branch}","tags_url":"https://api.github.com/repos/sarashahbaig/solar-system/tags","blobs_url":"https://api.github.com/repos/sarashahbaig/solar-system/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sarashahbaig/solar-system/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sarashahbaig/solar-system/git/refs{/sha}","trees_url":"https://api.github.com/repos/sarashahbaig/solar-system/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sarashahbaig/solar-system/statuses/{sha}","languages_url":"https://api.github.com/repos/sarashahbaig/solar-system/languages","stargazers_url":"https://api.github.com/repos/sarashahbaig/solar-system/stargazers","contributors_url":"https://api.github.com/repos/sarashahbaig/solar-system/contributors","subscribers_url":"https://api.github.com/repos/sarashahbaig/solar-system/subscribers","subscription_url":"https://api.github.com/repos/sarashahbaig/solar-system/subscription","commits_url":"https://api.github.com/repos/sarashahbaig/solar-system/commits{/sha}","git_commits_url":"https://api.github.com/repos/sarashahbaig/solar-system/git/commits{/sha}","comments_url":"https://api.github.com/repos/sarashahbaig/solar-system/comments{/number}","issue_comment_url":"https://api.github.com/repos/sarashahbaig/solar-system/issues/comments{/number}","contents_url":"https://api.github.com/repos/sarashahbaig/solar-system/contents/{+path}","compare_url":"https://api.github.com/repos/sarashahbaig/solar-system/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sarashahbaig/solar-system/merges","archive_url":"https://api.github.com/repos/sarashahbaig/solar-system/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sarashahbaig/solar-system/downloads","issues_url":"https://api.github.com/repos/sarashahbaig/solar-system/issues{/number}","pulls_url":"https://api.github.com/repos/sarashahbaig/solar-system/pulls{/number}","milestones_url":"https://api.github.com/repos/sarashahbaig/solar-system/milestones{/number}","notifications_url":"https://api.github.com/repos/sarashahbaig/solar-system/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sarashahbaig/solar-system/labels{/name}","releases_url":"https://api.github.com/repos/sarashahbaig/solar-system/releases{/id}","deployments_url":"https://api.github.com/repos/sarashahbaig/solar-system/deployments","created_at":"2019-08-19T21:33:40Z","updated_at":"2019-08-21T01:48:56Z","pushed_at":"2019-08-21T01:48:54Z","git_url":"git://github.com/sarashahbaig/solar-system.git","ssh_url":"git@github.com:sarashahbaig/solar-system.git","clone_url":"https://github.com/sarashahbaig/solar-system.git","svn_url":"https://github.com/sarashahbaig/solar-system","homepage":"","size":43,"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,"disabled":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"Ada-C12:master","ref":"master","sha":"536dbcae3dbde471eaaf3eee20a3f936b7727351","user":{"login":"Ada-C12","id":50816531,"node_id":"MDEyOk9yZ2FuaXphdGlvbjUwODE2NTMx","avatar_url":"https://avatars1.githubusercontent.com/u/50816531?v=4","gravatar_id":"","url":"https://api.github.com/users/Ada-C12","html_url":"https://github.com/Ada-C12","followers_url":"https://api.github.com/users/Ada-C12/followers","following_url":"https://api.github.com/users/Ada-C12/following{/other_user}","gists_url":"https://api.github.com/users/Ada-C12/gists{/gist_id}","starred_url":"https://api.github.com/users/Ada-C12/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ada-C12/subscriptions","organizations_url":"https://api.github.com/users/Ada-C12/orgs","repos_url":"https://api.github.com/users/Ada-C12/repos","events_url":"https://api.github.com/users/Ada-C12/events{/privacy}","received_events_url":"https://api.github.com/users/Ada-C12/received_events","type":"Organization","site_admin":false},"repo":{"id":202815848,"node_id":"MDEwOlJlcG9zaXRvcnkyMDI4MTU4NDg=","name":"solar-system","full_name":"Ada-C12/solar-system","private":false,"owner":{"login":"Ada-C12","id":50816531,"node_id":"MDEyOk9yZ2FuaXphdGlvbjUwODE2NTMx","avatar_url":"https://avatars1.githubusercontent.com/u/50816531?v=4","gravatar_id":"","url":"https://api.github.com/users/Ada-C12","html_url":"https://github.com/Ada-C12","followers_url":"https://api.github.com/users/Ada-C12/followers","following_url":"https://api.github.com/users/Ada-C12/following{/other_user}","gists_url":"https://api.github.com/users/Ada-C12/gists{/gist_id}","starred_url":"https://api.github.com/users/Ada-C12/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ada-C12/subscriptions","organizations_url":"https://api.github.com/users/Ada-C12/orgs","repos_url":"https://api.github.com/users/Ada-C12/repos","events_url":"https://api.github.com/users/Ada-C12/events{/privacy}","received_events_url":"https://api.github.com/users/Ada-C12/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/Ada-C12/solar-system","description":"Project: Create a CLI program that interacts with one Solar System and many Planets using OO principles","fork":true,"url":"https://api.github.com/repos/Ada-C12/solar-system","forks_url":"https://api.github.com/repos/Ada-C12/solar-system/forks","keys_url":"https://api.github.com/repos/Ada-C12/solar-system/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Ada-C12/solar-system/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Ada-C12/solar-system/teams","hooks_url":"https://api.github.com/repos/Ada-C12/solar-system/hooks","issue_events_url":"https://api.github.com/repos/Ada-C12/solar-system/issues/events{/number}","events_url":"https://api.github.com/repos/Ada-C12/solar-system/events","assignees_url":"https://api.github.com/repos/Ada-C12/solar-system/assignees{/user}","branches_url":"https://api.github.com/repos/Ada-C12/solar-system/branches{/branch}","tags_url":"https://api.github.com/repos/Ada-C12/solar-system/tags","blobs_url":"https://api.github.com/repos/Ada-C12/solar-system/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Ada-C12/solar-system/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Ada-C12/solar-system/git/refs{/sha}","trees_url":"https://api.github.com/repos/Ada-C12/solar-system/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Ada-C12/solar-system/statuses/{sha}","languages_url":"https://api.github.com/repos/Ada-C12/solar-system/languages","stargazers_url":"https://api.github.com/repos/Ada-C12/solar-system/stargazers","contributors_url":"https://api.github.com/repos/Ada-C12/solar-system/contributors","subscribers_url":"https://api.github.com/repos/Ada-C12/solar-system/subscribers","subscription_url":"https://api.github.com/repos/Ada-C12/solar-system/subscription","commits_url":"https://api.github.com/repos/Ada-C12/solar-system/commits{/sha}","git_commits_url":"https://api.github.com/repos/Ada-C12/solar-system/git/commits{/sha}","comments_url":"https://api.github.com/repos/Ada-C12/solar-system/comments{/number}","issue_comment_url":"https://api.github.com/repos/Ada-C12/solar-system/issues/comments{/number}","contents_url":"https://api.github.com/repos/Ada-C12/solar-system/contents/{+path}","compare_url":"https://api.github.com/repos/Ada-C12/solar-system/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Ada-C12/solar-system/merges","archive_url":"https://api.github.com/repos/Ada-C12/solar-system/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Ada-C12/solar-system/downloads","issues_url":"https://api.github.com/repos/Ada-C12/solar-system/issues{/number}","pulls_url":"https://api.github.com/repos/Ada-C12/solar-system/pulls{/number}","milestones_url":"https://api.github.com/repos/Ada-C12/solar-system/milestones{/number}","notifications_url":"https://api.github.com/repos/Ada-C12/solar-system/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Ada-C12/solar-system/labels{/name}","releases_url":"https://api.github.com/repos/Ada-C12/solar-system/releases{/id}","deployments_url":"https://api.github.com/repos/Ada-C12/solar-system/deployments","created_at":"2019-08-17T00:23:52Z","updated_at":"2019-08-17T00:24:30Z","pushed_at":"2019-08-26T22:44:58Z","git_url":"git://github.com/Ada-C12/solar-system.git","ssh_url":"git@github.com:Ada-C12/solar-system.git","clone_url":"https://github.com/Ada-C12/solar-system.git","svn_url":"https://github.com/Ada-C12/solar-system","homepage":"","size":43,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":49,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":49,"license":null,"forks":49,"open_issues":49,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Ada-C12/solar-system/pulls/14"},"html":{"href":"https://github.com/Ada-C12/solar-system/pull/14"},"issue":{"href":"https://api.github.com/repos/Ada-C12/solar-system/issues/14"},"comments":{"href":"https://api.github.com/repos/Ada-C12/solar-system/issues/14/comments"},"review_comments":{"href":"https://api.github.com/repos/Ada-C12/solar-system/pulls/14/comments"},"review_comment":{"href":"https://api.github.com/repos/Ada-C12/solar-system/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Ada-C12/solar-system/pulls/14/commits"},"statuses":{"href":"https://api.github.com/repos/Ada-C12/solar-system/statuses/5e4791e31d423eb8e23692f105cfc2a46187b668"}},"author_association":"NONE"}}
other: {"actor":{"display_login":"tildeee"}}