From: dblack@... Date: 2007-08-04T21:23:14+09:00 Subject: Re: Object.private_instance_methods <--- Kernel.singleton_methods Hi -- On Sat, 4 Aug 2007, ronald braswell wrote: > How do the Kernel.singleton_methods get to be > Object.private_instance_methods? Following the trail in eval.c and class.c, it looks like they're bound to Ruby names with rb_define_global_function: rb_define_global_function("raise", rb_f_raise, -1); That, in turn, calls rb_define_module_function for Kernel, which establishes the method as (a) a singleton method of Kernel itself, and (b) a private instance method of Kernel. The private instance methods then trickle down. You can see them not only with Object but with other classes too: Class.new.private_instance_methods == Object.private_instance_methods => true David -- * Books: RAILS ROUTING (new! http://www.awprofessional.com/title/0321509242) RUBY FOR RAILS (http://www.manning.com/black) * Ruby/Rails training & consulting: Ruby Power and Light, LLC (http://www.rubypal.com)