Object#null? [![[version]](https://badge.fury.io/rb/nullquestion.svg)](https://badge.fury.io/rb/nullquestion) [![[ci]](https://github.com/janlelis/nullquestion/workflows/Test/badge.svg)](https://github.com/janlelis/nullquestion/actions?query=workflow%3ATest)

January 6, 2021 ยท View on GitHub

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:

gem 'null_question'

Usage

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.