Adds the null? predicate to Ruby's nil
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
lib
spec
.gitignore
.travis.yml
CHANGELOG.md
Gemfile
MIT-LICENSE.txt
README.md
Rakefile
null_question.gemspec

README.md

Object#null? [version] [travis]

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 http://janlelis.com. Released under the MIT license.