Module: Mongoid::Criterion::Inspection

Included in:
Mongoid::Criteria
Defined in:
lib/mongoid/criterion/inspection.rb

Instance Method Summary collapse

Instance Method Details

#inspectString

Get a pretty string representation of the criteria, including the selector, options, matching count and documents for inspection.

Examples:

Inspect the criteria.

criteria.inspect

Returns:

  • (String)

    The inspection string.

Since:

  • 1.0.0



15
16
17
18
19
20
21
22
23
24
25
# File 'lib/mongoid/criterion/inspection.rb', line 15

def inspect
  ::I18n.translate(
    "mongoid.inspection.criteria",
    {
      selector: selector.inspect,
      options: options.inspect,
      klass: klass,
      embedded: embedded?
    }
  )
end