In article <3BD58DB4.2090404 / emn.fr>, Pierre-Charles David <Pierre-Charles.David / emn.fr> wrote: >Morris, Chris wrote: I was looking through your code snippet and there is an idiom that I don't understand, so I thought I'd ask and maybe learn something... > >---------------------------------------------------- >class Module > def deprecate(methodName) What does this following line mean/do? > module_eval <<END > alias_method :deprecated_#{methodName}, :#{methodName} > def #{methodName}(*args) > $stderr.puts "Warning: calling deprecated method >#{self}.#{methodName}" > return deprecated_#{methodName}(*args) > end >END > end >end > >class Foo > def print; puts "foo"; end >end > >Foo.new.print > >class Foo > deprecate :print >end > >Foo.new.print Phil