From: Walle Wallen Date: 2010-04-29T02:03:07+09:00 Subject: Overload the normal behavior of an object/instance in string Long story short. I'm trying to overload the normal behavior of an object/instance in a string. Instead of replying "" I would like it too return a specific string, or something similar. I have tried to overload inspect, and it seems to work pretty well, except when using the object with puts or in a string "#{p}". My english ain't good, but I hope you understand the principle of what I am trying to achieve. [code] class Test def inspect puts "this is a test" end end p = Test.new this is a test >> p this is a test puts p # >> "#{p}" => "#" [/code] -- Posted via http://www.ruby-forum.com/.