Discussion Forums
- Topic List
- Most Recent Posts
- Sign In for more options
Hi,
puts object.yaml renders object's properties slight nice than inspect method.Actually I need object properties in a structured fashion like print_r() of PHP function does.
Thanks for reply
Simply redefine the inspect method.
class YourObjectClass def inspect
# build the string you want inspect to return
end end
As simple as that. Also you can use .to_yml as an alternative.
Cheers
Dear All, I need to work with inspect method to customize it because inspect method does not print-out object's properties nicely(PHP print_r() method prints object's properties nicely and readably). So I need to customize inspect method. I know so far I have to work with kernel,Please please help me with this issue
