Dear all,


Class Test
  def methodA
    puts(@var1)
  end
  def initialize
    @var1 = 0
  end
end

obj = Object.new
obj.instance_variable_set(:@var1, 2)


# Now I want obj to be Test's instance, so I can
obj.methodA
# How to do this quickly?



Thanks.