From: Joe Van Dyk Date: 2005-12-23T08:12:01+09:00 Subject: Re: How do you know what class defines method foo()? On 12/22/05, Sam Kong wrote: > Hi, folks! > > What's the easiest(simplest) code to find a class/module that first > defines a specific method? $ ri partition --------------------------------------------------- Enumerable#partition enum.partition {| obj | block } => [ true_array, false_array ] ------------------------------------------------------------------------ Returns two arrays, the first containing the elements of _enum_ for which the block evaluates to true, the second containing the rest. (1..6).partition {|i| (i&1).zero?} #=> [[2, 4, 6], [1, 3, 5]]