Friday, 27 September 2013

delete and return all items in an array

delete and return all items in an array

Is there a helper method to delete all items from an array and return
those items in ruby?
For example,
array = [{:a=>1, :b=>2},{:a=>3,:b=>4},{:a=>5,:b=>6}]
and I want to delete all the array elements and return them so I can do
some processing on those elements?

No comments:

Post a Comment