From: "Jan E." Date: 2012-07-06T23:43:58+09:00 Subject: Re: basic queries Hi, John Lee wrote in post #1067695: > why must type "def Drawing.give_me_a_circle"? > why can't i type "def give_me_a_cirlce" instead? Because the method is supposed to be a class method and not an instance method. If you type "def give_me_a_circle", you define a method for the instances of Drawing: #------------------------------- class Drawing def give_me_a_circle puts "Here's the circle!" end end drawing_1 = Drawing.new # call the method for an instance of Drawing: drawing_1.give_me_a_circle #------------------------------- But what you actually want is to define a method for the class Drawing itself. That's why you have to prepend "Drawing": #------------------------------- class Drawing def Drawing.give_me_a_circle puts "Here's the circle!" end end # call the method for Drawing: Drawing.give_me_a_circle #------------------------------- -- Posted via http://www.ruby-forum.com/.