私は次のクラスを持っています:
class User
code1 = Proc.new { }
code2 = lambda { }
define_method :test do
self.class.instance_eval &code1
self.class.instance_eval &code2
end
end
User.new.test
instance_eval
2番目がエラーで失敗するのはなぜwrong number of arguments (1 for 0)
ですか?