From: Dhaval Date: 2009-11-13T09:05:07+09:00 Subject: newbie ..need help with metaprogramming.. hi, i wrote a small code to check metaprogramming in ruby..what am i doing wrong..can you pl help? class Testvar attr_accessor :a1 def initialize @a1='init' end end var =":a1" t = Testvar.new if t.respond_to?("#{var}") p 'test 1- pass' end if t.instance_variable_set var , 'abc' p 'test 2-pass' end if t.send var , 'def' p 'test 3-pass' end