I like Luc's but ever since I got hit with inject:

class Array
   def indices_of(obj)
     self.inject([]) { |arr, element| arr << element if element == obj; arr
}
   end
end

And I like indices not because I'm language nazi but because of personal
preference. :)

On Fri, Feb 26, 2010 at 10:35 AM, Marc Heiler <shevegen / linuxmail.org>wrote:

> > Second day with Ruby, huh...
>
> Ruby simplifies thinking.
> --
> Posted via http://www.ruby-forum.com/.
>
>