Skip to content

Conversation

@jocegonz
Copy link

@jocegonz jocegonz commented Aug 16, 2017

Solar System

Congratulations! You're submitting your assignment.

Comprehension Questions

Question Answer
What was the purpose of the initialize method in your class? To create set variables for my class variables
Describe an instance variable you used and what you used it for. @name created a name under the instance variable name
Describe what the difference would be if your SolarSystem used an Array vs a Hash. I think I would have to declare my keys in my hash as instance variables. The array takes a list of values that need to be kept in a specific order to retain.
Do you feel like you used consistent indentation throughout your code? Yes

@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. indentation got messy in the Planet class
Created a pull request with your name & the template questions answered. x

@@ -0,0 +1,89 @@

class SolarSystem
attr_reader :ss_user_choice
Copy link

Choose a reason for hiding this comment

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

I don't think you need an attr_reader for ss_user_choice-- you've defined ss_user_choice as the name of a method. attr_reader helps make method definitions if you give it an instance variable.

end

class Planet
attr_accessor :name, :moons, :year_length, :distance_from_the_sun, :named_after, :print_planet
Copy link

Choose a reason for hiding this comment

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

Again, you don't need to add print_planet to an attr_accessor. print_planet is the name of a method, which can already be called with .print_planet. attr_accessors are for instance variables

@tildeee
Copy link

tildeee commented Aug 22, 2017

Good job on the assignment. You successfully created instances of SolarSystem and Planet and used them! I've added a couple of notes about your code.

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