Sha256: 0f181c34804ba6a48bf84f67aa2bdf138792c6bd42090da8dd2fa0a50be944ea

Contents?: true

Size: 327 Bytes

Versions: 14

Compression:

Stored size: 327 Bytes

Contents

module Toy
  module Inspect
    extend ActiveSupport::Concern

    def inspect
      attributes_as_nice_string = self.class.attributes.keys.map(&:to_s).sort.map do |name|
        "#{name}: #{read_attribute(name).inspect}"
      end.join(", ")
      "#<#{self.class}:#{object_id} #{attributes_as_nice_string}>"
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
toystore-0.9.0 lib/toy/inspect.rb
toystore-0.8.3 lib/toy/inspect.rb
toystore-0.8.2 lib/toy/inspect.rb
toystore-0.8.1 lib/toy/inspect.rb
toystore-0.8.0 lib/toy/inspect.rb
toystore-0.7.0 lib/toy/inspect.rb
toystore-0.6.6 lib/toy/inspect.rb
toystore-0.6.5 lib/toy/inspect.rb
toystore-0.6.4 lib/toy/inspect.rb
toystore-0.6.3 lib/toy/inspect.rb
toystore-0.6.2 lib/toy/inspect.rb
toystore-0.6.1 lib/toy/inspect.rb
toystore-0.6 lib/toy/inspect.rb
toystore-0.5 lib/toy/inspect.rb