Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/benmuiruri/parity-gem
A simple gem to split an array of integers into two arrays of odd and even integers
https://github.com/benmuiruri/parity-gem
gem rspec ruby
Last synced: 25 days ago
JSON representation
A simple gem to split an array of integers into two arrays of odd and even integers
- Host: GitHub
- URL: https://github.com/benmuiruri/parity-gem
- Owner: Benmuiruri
- Created: 2022-10-29T06:01:39.000Z (over 2 years ago)
- Default Branch: development
- Last Pushed: 2022-11-22T10:13:14.000Z (about 2 years ago)
- Last Synced: 2025-01-10T17:42:50.684Z (about 1 month ago)
- Topics: gem, rspec, ruby
- Language: Ruby
- Homepage:
- Size: 26.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# parity-gem
`interger_parity` is a simple gem to split an array of integers into two arrays of odd and even integers.
## Installation
To install `interger_parity`, add this line to your application's `Gemfile`:
```
gem 'interger_parity'
```Then install as follows:
```
$ bundle install
```Or install it directly using `gem install`:
```
$ gem install interger_parity
```## Usage
`interger_parity` adds a `split_by_parity` method to the `Array` class, and can be used as follows:
```
$ irb
>> require 'interger_parity'
>> [1, 2, 3, 4, 5, 6].split_by_parity)
=> [2, 4, 6], [1, 3, 5]
```## License
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).