Skip to content

Conversation

@julmeier
Copy link

Solar System

Congratulations! You're submitting your assignment.

Comprehension Questions

Question Answer
What was the purpose of the initialize method in your class?
Describe an instance variable you used and what you used it for.
Describe what the difference would be if your SolarSystem used an Array vs a Hash.
Do you feel like you used consistent indentation throughout your code?

@tildeee
Copy link

tildeee commented Aug 22, 2017

Solar System

What We're Looking For

Feature Feedback
Created Custom Class with initialize method & instance variables. x
Used an Array to store a list of planets in the SolarSystem class. x
Readable code with consistent indentation. x
Created a pull request with your name & the template questions answered. Something happened to your answers!

mysolarsystem.add_planet_to_solar_system(new_planet)

else
"You did not enter a valid entry. Please type 1 or 2."
Copy link

@tildeee tildeee Aug 22, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small thing: You forgot to put puts at the beginning of this line!

@tildeee
Copy link

tildeee commented Aug 22, 2017

This is observing the code in the file solarsystem8.rb

Good work on the assignment. You did a good job of defining classes and methods, and making instances of those classes and methods.
You have a great method in Planet called display_planet_details that you don't use-- you might want to consider using that method, instead of accessing the planet's details in Solar System. Doing this allows the Solar System to not know the internals of the Planet class, and lets Planet be responsible for its own printing.

In response to the question at the end of your code:
.all_planets accesses the information in the instance variable @all_planets in SolarSystem. In this case, @all_planets has an array of Planet objects. When you simply print/puts an instance of an object, it returns the object's id, because it doesn't know how to print itself otherwise.
Let me know if you have more questions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants