On Monday 16 August 2004 08:47 am, Daniel Cremer wrote:
> Is there a way to get variables to return their symbol so you can access
> what they will be referencing in the future ?

class C
  attr_accessor :a, :b, :c
  def initialize
    @a, @b, @c = 1, 2, 3
  end
  def bump
    @a, @b, @c = 100, 200, 300
  end
  def ref
    return [ lambda { @a }, lambda { @b }, lambda { @c } ]
  end
end

c = C.new
v = c.ref
v.each { |q| puts q.call }
c.bump
v.each { |q| puts q.call }

-- 
T.