From: Stefan Rusterholz Date: 2008-09-28T08:00:47+09:00 Subject: Re: Variable name to string reuben doetsch wrote: > I would like to get the name of the variable in string form, any way > this is > possible? No. > var = 5 > puts var.foo #Want this ti put var Variables are not objects. Methods operate on objects. Your .foo operates on 5 (the object your variable 'foo' references), not on 'var'. For that reason it can't work. > i looked into trying to do var.object_id.id2name but some reason this > gave me nil, since if it is bugged or object_id is not returning the correct > object id. What should it give you if your object is referenced by multiple variables? But it won't work anyway for the above stated reason. Regards Stefan -- Posted via http://www.ruby-forum.com/.