Module: Mongoid::Extensions::NilClass

Defined in:
lib/mongoid/extensions/nil_class.rb

Instance Method Summary collapse

Instance Method Details

#__setter__nil

Try to form a setter from this object.

Examples:

Try to form a setter.

object.__setter__

Returns:

  • (nil)

    Always nil.

Since:

  • 3.1.0


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

def __setter__
  self
end

#collectionizeString

Get the name of a nil collection.

Examples:

Get the nil name.

nil.collectionize

Returns:

  • (String)

    A blank string.

Since:

  • 1.0.0


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

def collectionize
  to_s.collectionize
end