From: Tom Sawyer Date: 2002-07-22T03:17:34+09:00 Subject: module_eval: adding a method to a class with a proc i'm having a little problem that i'm not sure how to solve. i'm trying to add a method to a class with a Proc using module_eval: a rough example: x = Proc.new { 5 + 5 } class C def initialize end end C.module_eval { def ten x end } c = C.new puts c.ten i end up getting 'ten': undefined local variable or method. that makes sense but how do i get around it? what i want is for the definition of ten to evalutate like: def ten 5 + 5 end anyone? ~transami _(")_ letter man \v/ ^ ^