From: dblack@... Date: 2006-11-27T08:28:51+09:00 Subject: Re: Extremely Noobish Documentation Question Hi -- On Mon, 27 Nov 2006, Paul Lutus wrote: > Patrick McNally wrote: > >>> open methed is a method defined in kernel module >> >> Thank you for the quick response. I see that now but I guess my >> underlying questions still remains. What should indicate that the >> method is part of Kernel and why is it invoked when I call 'File.open'? > > Because the File class inherits all the methods from the Kernel class: > > p File.ancestors > > [File, IO, File::Constants, Enumerable, Object, Kernel] > > > Like any other class, File has access to the methods of its ancestors. In this case, though, the open that gets called is the class method from IO, rather than the instance method from Kernel. All objects have access to that instance method, but since it's private, it doesn't usually do them much good. David -- David A. Black | dblack@wobblini.net Author of "Ruby for Rails" [1] | Ruby/Rails training & consultancy [3] DABlog (DAB's Weblog) [2] | Co-director, Ruby Central, Inc. [4] [1] http://www.manning.com/black | [3] http://www.rubypowerandlight.com [2] http://dablog.rubypal.com | [4] http://www.rubycentral.org