Module: CouchbaseOrm::Inspectable

Included in:
Document
Defined in:
lib/couchbase-orm/inspectable.rb

Overview

Contains the behavior around inspecting documents via inspect.

Instance Method Summary collapse

Instance Method Details

#inspectString

Returns the class name plus its attributes.

Examples:

Inspect the document.

person.inspect

Returns:

  • (String)

    A nice pretty string to look at.



14
15
16
17
18
# File 'lib/couchbase-orm/inspectable.rb', line 14

def inspect
  inspection = []
  inspection.concat(inspect_attributes)
  "#<#{self.class.name} id: #{respond_to?(:id)? id.inspect : 'no id'}, #{inspection * ', '}>"
end