On Tue, Jun 22, 2004 at 12:24:21AM +0900, Sean O'Dell wrote: > > In irb, I tested it like the following. > > > > def my_f > > p "my_f" > > end > > > > Object.my_f #=> print "my_f" > > obj = Object.new > > obj.my_f #=> print "my_f" > > > > Then, my_f is an instance method, and a class method as well? > > > > Can anyone help me understand it? > > The Object class is the base of every other class, and is itself an instance > of class Class. irb can sometimes mislead you: $ ruby def foo; 1 end Object.foo -:2: private method `foo' called for Object:Class (NoMethodError) -- Running Debian GNU/Linux Sid (unstable) batsman dot geo at yahoo dot com (It is an old Debian tradition to leave at least twice a year ...) -- Sven Rudolph