BlankElement
remove blank or null elements from Array object
Installation
Add this line to your application's Gemfile:
gem 'blank_element'
And then execute:
$ bundle
Or install it yourself as:
$ gem install blank_element
Usage
require 'blank_element'
array = ['battleship', 'cruiser', 'destroyer', ' ']
array.blank_all? # => false
arra.present_any? # => true
array.reject_blank # => ['battleship', 'cruiser', 'destroyer']
array.reject_blank! # => bang method
blank_array = [' ', ' ', ' ']
blank_array.blank_all? # => true
blank_array.present_any? # => false
empty_array = []
empty_array.blank_all? # => true
empty_array.present_any? # => false
Contributing
- Fork it ( http://github.com//blank_element/fork )
- 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