From: ianm@... (Ian MacLean) Date: 2001-11-17T01:09:48+09:00 Subject: [ruby-talk:25463] accessing instance variables in ruby debugger If I have an instance of small ruby class with 2 instance variables and I view it in the debugger I get: "" however if I enter "v i obj" ( view instance variables of obj ) I get @myitem => nil @myotheritem => nil On closer inspection debug.rb is calling obj.inspect to get "". When viewing the instance variables the following code is run: ary = obj.instance_variables ary.sort! for v in ary stdout.printf " %s => %s\n", v, eval(v, binding).inspect end so its calling eval on @myitem which of course will fail as @myitem is an instance variable of obj. my question is how do I access @myitem in a fully qualified way ie obj.@myitem ? ( which gives me a parse error ) can I do this or can I only access instance variables via accessors ? If the above is true then how does inspect pull out the value correctly. please let me know if I'm missing somthing obvious. I've been scouring pickake to no avail Ian here is the simple code I was testing against class MyTest def initialize() @myitem = 10 @myotheritem = 12 end def myitem @myitem end def myitem=(newitem) @myitem = newitem end end obj= MyTest.new() puts obj.myitem