From: ara.t.howard@... Date: 2006-01-17T05:21:36+09:00 Subject: Re: overriding Object::send On Tue, 17 Jan 2006, Joe Van Dyk wrote: > Why doesn't this work? > > class Object > alias_method :old_send, :send > def send meth, *args > STDERR.puts "#{ meth } was called" > old_send meth, args > end > end > > harp:~ > cat a.rb class Object def send meth, *a, &b STDERR.puts "#{ self.class }##{ meth }" __send__ meth, *a, &b end end 42.send "display" harp:~ > ruby a.rb Fixnum#display 42 hth. -a -- strong and healthy, who thinks of sickness until it strikes like lightning? preoccupied with the world, who thinks of death, until it arrives like thunder? -- milarepa