From: James Edward Gray II Date: 2005-12-02T22:43:09+09:00 Subject: Re: require! On Dec 2, 2005, at 12:13 AM, Hal Fulton wrote: > James Edward Gray II wrote: >> On Nov 30, 2005, at 7:52 PM, Ross Bamford wrote: >>> On another note, though, I also found out that calling amethod >>> (*args) works with anything with 'each' (any Enumerable?), which >>> made me smile. It was the post about ranges that made me get that :) >> Actually * looks for a to_a. > > I always thought it looked for to_ary... now someone says it looks > first for to_ary, then to_a. > > And I had no idea that it would work with just #each defined. It doesn't: >> class NoArr >> def each >> yield 1 >> yield 2 >> yield 3 >> end >> undef to_a >> end => nil >> def multi( one, two, three ) >> p one >> p two >> p three >> end => nil >> multi( *NoArr.new ) NoMethodError: undefined method `to_a' for # from (irb):14 James Edward Gray II