awesome-print / awesome_print

Pretty print your Ruby objects with style -- in full color and with proper indentation
http://github.com/michaeldv/awesome_print
MIT License
4.07k stars 454 forks source link

possible to hide some record attributes in ai ? #368

Closed MathieuDerelle closed 3 years ago

MathieuDerelle commented 4 years ago

example : a model Country with an attribute :geometry containing the geometry to display on a map (i.e all the coordinates on the border)

There are long long long arrays which are unreadable in the console (console which uses ai output : Pry.config.print = proc { |output, value| output.puts value.ai })

Is is possible to mark this attribute :geometry in some way, in order to not show it in ai output ?

BryanH commented 3 years ago

PRs are always welcome. Is this the behavior you are looking for? (Reopen this issue if you're still interested)

Data example

a = { 'foo':'bar', 'alpha':'beta' }

Mark key alpha as not displayed (config? or on each call?)

Desired output

a = {
  'foo': 'bar'
}

...or something like that