https://github.com/zw963/only_blank
The only blank? for ruby
https://github.com/zw963/only_blank
Last synced: about 1 year ago
JSON representation
The only blank? for ruby
- Host: GitHub
- URL: https://github.com/zw963/only_blank
- Owner: zw963
- License: mit
- Created: 2021-05-24T06:20:25.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2022-04-23T15:51:00.000Z (about 4 years ago)
- Last Synced: 2025-03-13T06:36:29.680Z (about 1 year ago)
- Language: Ruby
- Size: 15.6 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG
- License: LICENSE
Awesome Lists containing this project
README
# only_blank [](https://app.travis-ci.com/github/zw963/only_blank)[](http://badge.fury.io/rb/only_blank)
A tiny library for bring the ruby on rails awesome `blank?` method and friends to ruby.
## Getting Started
Add to your Gemfile
```rb
gem 'only_blank'
```
Then, you get three method `blank?`, `present?`, `presence` defined on following class free.
`FalseClass`, `Object`, `NilClass`, `Numeric`, `String`, `TrueClass`.
## Credits
Basically, this gem just a tiny wrapper around two library.
1. [The sequel blank extension](https://github.com/jeremyevans/sequel/blob/master/lib/sequel/extensions/blank.rb) which implement the same blank? logic as Ruby On Rails.
2. [fast_blank gem](https://github.com/SamSaffron/fast_blank), which is a simple C extension which provides a very fast implementation of `String#blank?` method.