-
Notifications
You must be signed in to change notification settings - Fork 44
(Ampers) Leticia Tran - Solar System #28
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?
Conversation
Solar SystemWhat We're Looking For
|
|
|
||
| def initialize(planets_array) | ||
| @solar_system = planets_array | ||
| @names = [] |
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.
Does this need to be an instance variable? It looks like it could be used instead as a local variable in create_names.
|
|
||
| # Grab only th names of planets from the planets_array and push it to the new array @names: | ||
| def create_names | ||
| @solar_system.each do |planets_data| |
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.
If I call create_names twice I'll end up with my list doubled!
| end | ||
| end | ||
|
|
||
| def return_planets_name_variable #how to make this betteR? |
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.
maybe just call it planet_names
|
|
||
| attr_reader :name, :year_length, :distance_from_the_sun, :planet_type, :interesting_fact1, :number_of_moons, :interesting_fact2 | ||
|
|
||
| def initialize (name, year_length, distance_from_the_sun, planet_type, interesting_fact1, number_of_moons, interesting_fact2) |
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.
best not to put a space between initialize and the (
Solar System
Congratulations! You're submitting your assignment.
Comprehension Questions
initializemethod in your class?SolarSystemused anArrayvs aHash.