From: ts Date: 2001-10-28T20:55:55+09:00 Subject: [ruby-talk:23675] Re: sleeping, calling methods inside class defs >>>>> "T" == Tobias Reif writes: T> Now I'd like to know why this *does* work: T> ----- T> def hey T> "hey!\n" T> end T> print hey T> ----- T> Do I define a method for instances of class Object, and when methods are T> called, I get an instance of Object for free? You define an instance method of Object, but the top level is an instance of Object. Object is the root of the hierarchy. Try this pigeon% cat b.rb #!/usr/bin/ruby def Object.tt puts "tt" end def uu puts "uu" end class A def a tt end def b uu end end A.new.b A.new.a pigeon% pigeon% b.rb uu ./b.rb:12:in `a': undefined local variable or method `tt' for # (NameError) from ./b.rb:20 pigeon% Guy Decoux