Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Assignment Submission: Solar System
Congratulations! You're submitting your assignment. Please reflect on the assignment with these questions.
Reflection
initialize
method run? What does it do?| Why do you imagine we made our instance variables readable but not writable? | We want it readable so that it only prints out that variable when it's called, not changed.
| How would your program be different if each planet was stored as a
Hash
instead of an instance of a class? | If it was a hash, we would have to iterate through that data structure to pull the information. It's easier to be able to call an instance of a class..| How would your program be different if your
SolarSystem
class used aHash
instead of anArray
to store the list of planets? | Sounds complicating. I don't think it'll be that different, because I would still have to iterate through. It might be useful to use for a many-to-manay object composition.| 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? | I think it follows it. The planet.rb is responsible for gathering information for a single planet. Solar_system handles a collection of planets, where I can write methods to print out information about any planet.
| How did you organize your
require
statements? Which files neededrequire
s, and which did not? What is the pattern? | main.rb needed require_relative statements to be able to pull in data from the class files. Without, main.rb wouldn't work because there wouldn't be a way to call in the data from planets and solar system (unless everything was written out in one file?)