Skip to content

v1.0.0

Latest
Compare
Choose a tag to compare
@joelmoss joelmoss released this 26 Oct 22:12
· 1 commit to master since this release

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>