Skip to content

Releases: joelmoss/inspectacular

v1.0.0

26 Oct 22:12
Compare
Choose a tag to compare

First release! 🎉

Fed up of lengthy #inspect output? 😩

Simply extend any object with Inspectacular to get a custom #inspect method with the given attributes.

class User < ApplicationRecord
  extend Inspectacular[:id, :name, :email]
end

User.first.inspect #=> "#<User id: 1, name: 'John Doe', email: '<john@doe.com>'>

If no attributes are given, the default is to inspect the object's #id attribute.

class Account < ApplicationRecord
  extend Inspectacular
end

Account.first.inspect #=> "#<Account id: 1>