Monday, January 25, 2010

1st problem encountered!

I mean getter/setter methods. I don't really see the reason why they are needed.

   class Book
     def initialize(title)
       @title = title
     end

     def title
       @title
     end
 
     def title=(title)
       @title = title
     end
   end


Could someone be so nice and describe me exactly what is going on, and if so please do it without using some fancy words. 

Thanks a lot!

1 comment:

  1. OK! I do get it now. I Googled a little bit and after readeing some other explenations I got it. :)

    ReplyDelete