Sha256: aacc4e0131c6820ff44ddf6d98b452749223ae049484e8dd9b196abc251389d2
Contents?: true
Size: 673 Bytes
Versions: 1
Compression:
Stored size: 673 Bytes
Contents
# Object#null? [![[version]](https://badge.fury.io/rb/null_question.svg)](http://badge.fury.io/rb/null_question) [![[travis]](https://travis-ci.org/janlelis/null_question.png)](https://travis-ci.org/janlelis/null_question) Adds NilClass#null? #=> true and Object#null? #=> false Useful for implementing custom null objects that 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 <http://janlelis.com>. Released under the MIT license.
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
null_question-1.0.0 | README.md |