On 9/13/06, gwtmp01 / mac.com <gwtmp01 / mac.com> wrote:

> Another nice thing about values_at is that it understands ranges:
>
> a = Array.new(10) { |x| x*2 }   #=> [0, 2, 4, 6, 8, 10, 12, 14, 16, 18]
>
> b = a.values_at(1,3,5..7)       #=> [2, 6, 10, 12, 14]

But not an array?!

irb(main):005:0> (0..10).to_a.values_at([2, 3, 4, 5])
TypeError: can't convert Array into Integer
        from (irb):5:in `values_at'
        from (irb):5
        from :0

This seems a little inconsistent, it would seem better if it handled
any arguments which were enumerables containing integers.

-- 
Rick DeNatale

My blog on Ruby
http://talklikeaduck.denhaven2.com/