Skip to content

Conversation

@RAgerone
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? Each class immediately calls initialize on the objects within. I'm not sure exactly what it does, but the class won't work correctly without it.
Describe an instance variable you used and what you used it for. @name was used to hold the string which housed planet name
Describe what the difference would be if your SolarSystem used an Array vs a Hash. array doesn't have keys. Each value would have to be accessed in a different way
Do you feel like you used consistent indentation throughout your code? I feel like I did, but I may have missed some

@PilgrimMemoirs
Copy link

Solar System

What We're Looking For

Feature Feedback
Created Custom Class with initialize method & instance variables. Well Done
Used an Array to store a list of planets in the SolarSystem class. Mostly Good - See note on SolarSystem Initialize Below
Readable code with consistent indentation. Well Done
Created a pull request with your name & the template questions answered. Almost - Initialize is not needed, but is used to set state of each instance of that class' objects and can be used to call other methods.
❗️ Submission does not meet expectations for this project. To fully meet expectations, fix the bugs in find_planet method to return the string if a condition is met (the name provided by the user matches a name of one of the planet objects within that solar system). It should also return the string instead of calling puts within the method. I suggest removing the asterisk in initialize to make this process more smooth. Please ask for any clarification. You can resubmit by emailing me and Dan.
Additional Feedback
SolarSystem initialize (*planets), using the asterisk before the argument will put everything in an array for you. Since you are already passing the planets in with an array, when you create the new SolarSystem instance, it will create a nested array. That nested array is likely what is giving you issues with iterating.
SolarSystem's new_planet method Do not use puts within the method. Instead, return the item. If you only had the line @planets<<(planet_hash), it will do that automagically for you since ruby returns the last line of a method. Also, update the argument variable, After wave 1 you should not be adding planet hashes anymore, but rather Planet Objects.
SolarSystem's planet_dictionary(planet) method There should be a method that returns the information of every planet in that solar system, by iterating through the @planets array.
This test: maybe_pluto = add_planet Would like to see it testing SolarSystem's new_planet method as well, instead of adding it to the array before the new SolarSystem instance is created.

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