Open
Conversation
718dcf1 to
b3a8804
Compare
added 2 commits
February 21, 2022 23:26
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
Reflection
| When does the
initializemethod run? What does it do? | This special method creates the @star_name and @alien_types objects.| Why do you imagine we made our instance variables readable but not writable? | Probably because we don’t want those attributes to change.
| How would your program be different if each planet was stored as a
Hashinstead of an instance of a class? | I don’t know.| How would your program be different if your
SolarSystemclass used aHashinstead of anArrayto store the list of planets? | The push/shovel method would not work to to place the aliens inside the hash. I would need to create a hash and set the symbols/keys equal to the instance variable holding alien_types.| 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 believe they do, the Alien_Type class deals more with creating the instance variables, or state and SolarSystem also has state but with more behavior.
| How did you organize your
requirestatements? Which files neededrequires, and which did not? What is the pattern? | Main.rb is the only file that needs ‘requires’. It appears like main is the central location that calls methods from all classes.