Hi,

I thought it'd be useful to have a method that is the opposite of Array.wrap
.
I've got this simple change drafted introducing Array.unwrap.

https://github.com/carnesmedia/rails/compare/unwrap

I've found this useful in situations where I know I'll get a one-element
array, and I just want the element, such as an api request that always
returns an array even though I asked for a single result, or when I'm not
sure I'll get an array or single element (the same situation as Array.wrap
except I want the single element of an array containing that element).

Anyway, I'm looking for feedback. Does anyone have thoughts before I make
this a pull-request?

-Amiel
http://carnesmedia.com

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Core" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/rubyonrails-core.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to