Sha256: f715410c49992802c31e0b2b908b58e9574d7a6d66a80b50156be75d45645f54

Contents?: true

Size: 996 Bytes

Versions: 1

Compression:

Stored size: 996 Bytes

Contents

# Egocentric Nil [![[version]](https://badge.fury.io/rb/egonil.svg)](http://badge.fury.io/rb/egonil)  [![[travis]](https://travis-ci.org/janlelis/egonil.png)](https://travis-ci.org/janlelis/egonil)

Creates a block, where `nil` does not raise `NoMethodError`s

```ruby
egonil do
  nil.some_methods.that[:do].not.exist
end
```


## Further Information

- [The Hopelessly Egocentric Blog Post](https://github.com/raganwald-deprecated/homoiconic/blob/master/2009-02-02/hopeless_egocentricity.md)
- [The 25 Bytes of Ruby Joy!](http://ruby.janlelis.de/26-the-28-bytes-of-ruby-joy)
- [Safe navigation operator](https://bugs.ruby-lang.org/issues/11537)
- Null objects with [null_question](https://github.com/janlelis/null_question) and [exists](https://github.com/janlelis/exists) or [null_plus](https://github.com/janlelis/null_plus)


## Setup

Add to your `Gemfile`:

```ruby
gem 'egonil'
```


## MIT License

Copyright (C) 2010-2016 Jan Lelis <http://janlelis.com>. Released under the MIT license.

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
egonil-1.0.0 README.md