def awesome_mongo_mapper_instance(object)
      return object.inspect if !defined?(::ActiveSupport::OrderedHash)
      return awesome_object(object) if @options[:raw]

      data = object.keys.keys.sort_by { |k| k }.inject(::ActiveSupport::OrderedHash.new) do |hash, name|
        hash[name] = object[name]
        hash
      end

      # Add in associations
      if @options[:mongo_mapper][:show_associations]
        object.associations.each do |name, assoc|
          data[name.to_s] = if @options[:mongo_mapper][:inline_embedded] and assoc.embeddable?
                              object.send(name)
                            else
                              assoc
                            end
        end
      end

      label = object.to_s
      label = "#{colorize('embedded', :assoc)} #{label}" if object.is_a?(::MongoMapper::EmbeddedDocument)

      "#{label} " << awesome_hash(data)
    end
def awesome_mongo_mapper_instance(object)
      return object.inspect if !defined?(::ActiveSupport::OrderedHash)
      return awesome_object(object) if @options[:raw]

      data = object.keys.keys.sort_by { |k| k }.inject(::ActiveSupport::OrderedHash.new) do |hash, name|
        hash[name] = object[name]
        hash
      end

      # Add in associations
      if @options[:mongo_mapper][:show_associations]
        object.associations.each do |name, assoc|
          data[name.to_s] = if @options[:mongo_mapper][:inline_embedded] and assoc.embeddable?
                              object.send(name)
                            else
                              assoc
                            end
        end
      end

      label = object.to_s
      label = "#{colorize('embedded', :assoc)} #{label}" if object.is_a?(::MongoMapper::EmbeddedDocument)

      "#{label} " << awesome_hash(data)
    end
Format MongoMapper instance object.

 NOTE: by default only instance attributes (i.e. keys) are shown. To format
 MongoMapper instance as regular object showing its instance variables and
 accessors use :raw => true option:

 ap record, :raw => true

------------------------------------------------------------------------------