Module: Mongoid::Inspection
- Included in:
- Components
- Defined in:
- lib/mongoid/inspection.rb
Overview
:nodoc
Instance Method Summary collapse
-
#inspect ⇒ Object
Returns the class name plus its attributes.
Instance Method Details
#inspect ⇒ Object
Returns the class name plus its attributes. If using dynamic fields will include those as well.
Example:
person.inspect
Returns:
A nice pretty string to look at.
15 16 17 18 19 |
# File 'lib/mongoid/inspection.rb', line 15 def inspect inspection = [] inspection.concat(inspect_fields).concat(inspect_dynamic_fields) "#<#{self.class.name} _id: #{id}, #{inspection * ', '}>" end |