https://github.com/boltops-tools/hash_squeezer
Squeeze hash and removes nil and empty arrays values
https://github.com/boltops-tools/hash_squeezer
Last synced: 10 months ago
JSON representation
Squeeze hash and removes nil and empty arrays values
- Host: GitHub
- URL: https://github.com/boltops-tools/hash_squeezer
- Owner: boltops-tools
- License: apache-2.0
- Created: 2020-06-18T18:23:35.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2020-07-16T15:46:42.000Z (almost 6 years ago)
- Last Synced: 2025-06-08T23:35:16.955Z (about 1 year ago)
- Language: Ruby
- Homepage:
- Size: 7.81 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# HashSqueezer
Squeeze hash and removes nil and empty arrays values, even if they are nested.
## Installation
Add this line to your application's Gemfile:
```ruby
gem 'hash_squeezer'
```
And then execute:
$ bundle install
Or install it yourself as:
$ gem install hash_squeezer
## Usage
```ruby
data = {
a: 1,
b: nil,
c: [],
d: {e: nil},
}
HashSqueezer.squeeze(data) => {a: 1}
```
## Contributing
Bug reports and pull requests are welcome on GitHub at https://github.com/boltops-tools/hash_squeezer.