From: "David A. Black" Date: 2008-11-11T05:21:06+09:00 Subject: Re: Problem with object methods? Hi -- On Tue, 11 Nov 2008, Carter Davis wrote: > The text of the program was as follows: > > puts "before class : #{self.inspect}" > > class FirstClass > def initialize > puts "YAY INITIALIZE!" > puts "in initialize : #{self.inspect}" > end > puts "inside class : #{self.inspect}" > # text > > def text > puts "Yay more text!" > puts "inside test method : #{self.inspect}" > end > end > > firstClass = FirstClass.new > firstClass.test The test method you're calling at the end is a pre-defined, private method defined in Kernel. I'm not sure what you're wanting or expecting it to do. Do you mean "text"? That will fail with an unknown method error, since you haven't defined a method text on your actual class object FirstClass (only on its instances). David -- Rails training from David A. Black and Ruby Power and Light: Intro to Ruby on Rails January 12-15 Fort Lauderdale, FL Advancing with Rails January 19-22 Fort Lauderdale, FL * * Co-taught with Patrick Ewing! See http://www.rubypal.com for details and updates!