123456789_123456789_123456789_123456789_123456789_

Module: Mongoid::Extensions::NilClass

Relationships & Source Files
Defined in: lib/mongoid/extensions/nil_class.rb

Overview

Adds type-casting behavior to NilClass.

Instance Method Summary

Instance Method Details

#__setter__nil

Deprecated.

Try to form a setter from this object.

Examples:

Try to form a setter.

object.__setter__

Returns:

  • (nil)

    Always nil.

[ GitHub ]

  
# File 'lib/mongoid/extensions/nil_class.rb', line 15

def __setter__
  self
end

#collectionizeString

Get the name of a nil collection.

Examples:

Get the nil name.

nil.collectionize

Returns:

  • (String)

    A blank string.

[ GitHub ]

  
# File 'lib/mongoid/extensions/nil_class.rb', line 26

def collectionize
  to_s.collectionize
end