Ruby Ruby Objects and Classes Variables and Methods Variables

Why the need to initialize and calling methods

Hi Team,

Maybe I am missing a key element of objects and methods but I am confused as to why you need to initialize AND call a method. It seems repetitive that you need to initialize, define, and then call.

Can someone explain it the process a more clearly or point me to a resource that will explain the steps in the process in more detail.

please note I am trying to understand the base process before moving in to attr_accessor stuff.

Thanks, Rob

1 Answer

Maciej Czuchnowski
Maciej Czuchnowski
36,432 Points

Explaining this properly would a long time. You will need to use other materials if these videos are not clear enough (which is OK, I always said that Treehouse videos are not always good for beginners). You could try Codecademy chapters on object-oriented programming, maybe this will clear some things for you: http://www.codecademy.com/courses/ruby-beginner-en-MFiQ6/0/1?curriculum_id=5059f8619189a5000201fbcb

If not, I recommend some more general CS courses like Harvard's CS50x or Stanford's CS106a (all available for free online, even on YouTube, but they use C and Java, not Ruby).