-
Notifications
You must be signed in to change notification settings - Fork 48
Ports - Shamira #41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Ports - Shamira #41
Conversation
Solar SystemWhat We're Looking For
|
| sol_system.new_planet | ||
| puts sol_system.list_planets | ||
| end | ||
| break |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This break is always going to make the loop exit.
| # @planets.name specify that you're searching the name | ||
| end | ||
|
|
||
| def list_planets_one |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This method seems a duplication of the above
| end | ||
| end | ||
|
|
||
| def new_planet |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would be better as a method which takes a Planet as an argument and adds it to the planets array. That way you're separating the user-input task from the task of storing and organizing the planets.
Solar System
Congratulations! You're submitting your assignment.
Comprehension Questions
initializemethod run? What does it do?Hashinstead of an instance of a class?SolarSystemclass used aHashinstead of anArrayto store the list of planets?requirestatements? Which files neededrequires, and which did not? What is the pattern?