From: Phrogz Date: 2006-10-06T04:20:15+09:00 Subject: Re: Associating data with a function Nobuyoshi Nakada wrote: > module ScratchArgument > def scratch_method(name) > meth = instance_method(name) > define_method(name) do |*args0| > *eo = *yield > imeth = meth.bind(self) > (class << self; self; end).class_eval do > define_method(name) do |*args| > args.unshift(*eo) > imeth.call(*args) > end > end > args0.unshift(*eo) > imeth.call(*args0) > end > end > end Wow, that's pretty crazy, Nobu! Thanks for the brain bending. :)