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 455 forks source link

awesome_print and plain old ruby objects #208

Open dgdosen opened 8 years ago

dgdosen commented 8 years ago

Is there a way to decorate a plain old ruby object so that aweseome_print is awesome with my object?

For example, I'm defining objects with fast_attributes - and I want to show the detail of the object in an awesome print way, only the print out leaves something to be desired:

I was hoping I could add an t_ap method or something like that to my object's class and awesome_print would be able to work with it.

Any advice?

waldyr commented 8 years ago

Thanks for using AwesomePrint.

For example, I'm defining objects with fast_attributes - and I want to show the detail of the object in an awesome print way, only the print out leaves something to be desired:

If I understood correctly, Using awesome_print version 1.7.0 and fast_attributes version 0.7, you could make use of the option raw: true. Is that what you were looking for?

screen shot 2016-06-19 at 12 49 04 pm

I was hoping I could add an t_ap method or something like that to my object's class and awesome_print would be able to work with it.

In the future, we are going to address your concern in a nicely fashion. Stay tuned :)

Quintasan commented 4 years ago

@waldyr did we get anywhere with this? Can I help?