From: Robert Klemme Date: 2010-09-08T21:12:50+09:00 Subject: Re: Receiving array naturally? On Wed, Sep 8, 2010 at 11:36 AM, Ammar Ali wrote: > On Wed, Sep 8, 2010 at 10:09 AM, Robert Klemme > wrote: >> You could do >> >> def simple(*a) >>  a.flatten.each do |x| >>    x.whatever >>  end >> end > > It's also possible to use * when passing the array to the method, > without changing the method: > >> some_items = [1, "more", %w{four six eight}] >> some_method *some_items Of course, but that's not what Terry asked for. He wanted to make it convenient for the caller so he could do m(1,2,3,4) m([1,2,3,4]) m(some_array) Kind regards robert -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/