Module: Mongoid::Extensions::NilClass

Defined in:
build/mongoid-7.3/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



16
17
18
# File 'build/mongoid-7.3/lib/mongoid/extensions/nil_class.rb', line 16

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



28
29
30
# File 'build/mongoid-7.3/lib/mongoid/extensions/nil_class.rb', line 28

def collectionize
  to_s.collectionize
end