Condense unruly arrays! I got tired of writing my_array.flatten.uniq.compact
in my code, so I wrote this gem. It simply wraps those calls in a simple, new method on Array
.
Add this line to your application's Gemfile:
gem 'array-condense', require: 'array/condense'
And then execute:
$ bundle
Or install it yourself as:
$ gem install array-condense
Install it, require it, and call #condense
or #condense!
on your Array
instance
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request