Module: Toy::Inspect
Defined Under Namespace
Modules: ClassMethods
Instance Method Summary collapse
Instance Method Details
#inspect ⇒ Object
16 17 18 19 20 21 22 |
# File 'lib/toy/inspect.rb', line 16 def inspect keys = self.class.attributes.keys attributes_as_nice_string = keys.map(&:to_s).sort.map do |name| "#{name}: #{read_attribute(name).inspect}" end "#<#{self.class}:#{object_id} #{attributes_as_nice_string.join(', ')}>" end |