Module: Mongoid::Inspectable
- Included in:
- Composable
- Defined in:
- lib/mongoid/inspectable.rb
Overview
Contains the bahviour around inspecting documents via inspect.
Instance Method Summary collapse
-
#inspect ⇒ String
Returns the class name plus its attributes.
Instance Method Details
#inspect ⇒ String
Returns the class name plus its attributes. If using dynamic fields will include those as well.
18 19 20 21 22 |
# File 'lib/mongoid/inspectable.rb', line 18 def inspect inspection = [] inspection.concat(inspect_fields).concat(inspect_dynamic_fields) "#<#{self.class.name} _id: #{id}, #{inspection * ', '}>" end |