Module: Mongoid::Extensions::Nil::Collectionization

Included in:
NilClass
Defined in:
lib/mongoid/extensions/nil/collectionization.rb

Overview

This module safeguards collection access on anonymous classes.

Instance Method Summary collapse

Instance Method Details

#collectionizeString

Get the name of a nil collection.

Examples:

Get the nil name.

nil.collectionize

Returns:

  • (String)

    A blank string.

Since:

  • 1.0.0



17
18
19
# File 'lib/mongoid/extensions/nil/collectionization.rb', line 17

def collectionize
  to_s.collectionize
end