Gem to split arrays by parity, odd/even
Add lines to your application's Gemfile:
source 'https://gem.fury.io/xhostcom/' do gem 'parity', '~> 0.0.4' end
gem 'parity', '~> 0.0.4', :github => 'xhostcom/parity'
And then execute:
$ bundle
Contribution directions go here.
The gem is available as open source under the terms of the MIT License.
source 'https://gem.fury.io/xhostcom/' do gem 'parity', '~> 0.0.4' end
gem "parity"
bundle install
gem list parity gem install parity
$ irb -r parity
even, odd = [1,2,3,4,5,6,7,8,9,0].split_by_parity => [[2, 4, 6, 8, 0], [1, 3, 5, 7, 9]]
ruby test/test_parity.rb