From: dblack@... Date: 2006-09-05T03:51:43+09:00 Subject: Re: times is a method? Hi -- On Tue, 5 Sep 2006, Dick Davies wrote: > On 04/09/06, Troy Denkinger wrote: >> Perhaps I misunderstood the OP, but it looks like he's wanting to walk the >> inheritance tree looking for the method which defines the "times" method. >> It's actually in Integer. The "times" method is different than the "*" >> method, by the way. > > I think you understood him right, and you're correct according to ri, > so why does > > Integer.methods.include? 'times' > > return false ? methods returns the methods that the object (in this case, the class object Integer) responds to. If you do: 3.methods.include?("times") you'll get true. 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