From: Lars Olsson Date: 2007-02-14T23:35:06+09:00 Subject: Initializing dynamic instance methods Hi list! What's the best way to remedy the error/warning that the following code produces? class Parent def self.foo() module_eval("def foo(); @foo; end") module_eval("def foo=(newfoo); @foo = newfoo; end") end end class Child < Parent foo end c = Child.new p c.foo (running with ruby -w) (eval):1: warning: instance variable @foo not initialized nil Sincerely /lasso