Module: Ripple::Inspection

Defined in:
ripple/lib/ripple/inspection.rb

Overview

Makes IRB and other inspect output a bit friendlier

Instance Method Summary (collapse)

Instance Method Details

- (Object) inspect

A human-readable version of the Document or EmbeddedDocument



20
21
22
23
24
# File 'ripple/lib/ripple/inspection.rb', line 20

def inspect
  attribute_list = attributes_for_persistence.except("_type").map {|k,v| "#{k}=#{v.inspect}" }.join(' ')
  identifier = self.class.embeddable? ? "" : ":#{key || '[new]'}"
  "<#{self.class.name}#{identifier} #{attribute_list}>"
end