Sha256: b4c5c8578e40692ca4832af1ad59bf6948e36bbb85ad743303918c9b95cbad2c
Contents?: true
Size: 724 Bytes
Versions: 1
Compression:
Stored size: 724 Bytes
Contents
# Object#null? [![[version]](https://badge.fury.io/rb/null_question.svg)](https://badge.fury.io/rb/null_question) [![[ci]](https://github.com/janlelis/null_question/workflows/Test/badge.svg)](https://github.com/janlelis/null_question/actions?query=workflow%3ATest) Adds `NilClass#null? #=> true` and `Object#null? #=> false` Useful for implementing custom null objects that will also return true for `#null?` ## Setup Add to your **Gemfile**: ```ruby gem 'null_question' ``` ## Usage ```ruby class NullObject def null? true end end nil.null? #=> true NullObject.new.null? #=> true Object.new.null? #=> false ``` ## J-_-L Copyright (C) 2015 Jan Lelis <https://janlelis.com>. Released under the MIT license.
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
null_question-1.0.1 | README.md |