Hi,

I think as Joshua, it's a very bad idea to do something like that.

Memoizing is something very quick to write in Ruby, and should *never* use
define_method.

Either use a constant when possible, or a regular method if you need to
evaluate it later.

I think these simple cases are really too less and should be avoided how
they are.

class Foo
 def value
   "some value" # Why would you use defined_method ?
  end
end

def value
  defined?(@a) ? @a : some_expensive_calculation
end

Any problem to this case ?

I saw the case over-complicated with the second rails link,
I think it can be improved by eval, that's the usual way to deal with the
"slow" define_method.

Regards,
B.D.