lib/awesome_print/ext/data_mapper.rb
def awesome_data_mapper_instance(object)
      return object.inspect if !defined?(::ActiveSupport::OrderedHash)
      return awesome_object(object) if @options[:raw]

      data = object.class.properties.map(&:name).inject(::ActiveSupport::OrderedHash.new) do |hash, name|
        value = object.respond_to?(name) ? object.send(name) : object.read_attribute(name)
        hash[name.to_sym] = value
        hash
      end
      "#{object} " << awesome_hash(data)
    end
# Format DataMapper instance object.
#
# NOTE: by default only instance attributes (i.e. columns) are shown. To format
# DataMapper instance as regular object showing its instance variables and
# accessors use :raw => true option:
#
# ap record, :raw => true
#
#------------------------------------------------------------------------------
Format DataMapper instance object.
NOTE: by default only instance attributes  are shown. To format
DataMapper instance as regular object showing its instance variables and
accessors use :raw => true option.

ap record, :raw => true
Format DataMapper instance object . NOTE : by default only instance attributes are shown . To format DataMapper instance as regular object showing its instance variables and accessors use : raw = > true option . ap record : raw = > true
def awesome_data_mapper_instance(object)
      return object.inspect if !defined?(::ActiveSupport::OrderedHash)
      return awesome_object(object) if @options[:raw]
      data = object.class.properties.map(&:name).inject(::ActiveSupport::OrderedHash.new) do |hash, name|
        value = object.respond_to?(name) ? object.send(name) : object.read_attribute(name)
        hash[name.to_sym] = value
        hash
      end
      "#{object} " << awesome_hash(data)
    end
def awesome_data_mapper_instance ( object ) return object . inspect if ! defined? ( :: ActiveSupport :: OrderedHash ) return awesome_object ( object ) if @options [ :raw ] data = object . class . properties . map ( & :name ) . inject ( :: ActiveSupport :: OrderedHash . new ) do | hash , name | value = object . respond_to? ( name ) ? object . send ( name ) : object . read_attribute ( name ) hash [ name . to_sym ] = value hash end "#{object} " << awesome_hash ( data ) end
Format DataMapper instance object.
Format DataMapper instance object .
object