From: "Christopher J. Bottaro" Date: 2008-03-22T01:13:59+09:00 Subject: dynamically defining a method on an instance that references vars in enclosing scope? Hello. I want to do this. instance = MyClass.new x = 1 def instance.foo puts x end undefined local variable or method `x' for # How do get rid of that error? Thanks for the help.