From: "David A. Black" Date: 2005-08-27T01:59:58+09:00 Subject: Re: Method behaves differently when called using #send Hi -- On Sat, 27 Aug 2005, Ron M wrote: > David A. Black wrote: >>> >>>>> es.y >>> => 30.468257171342 > >>>>> es.send(:y) >>> ArgumentError: wrong number of arguments (0 for 1) >>> from (irb):7:in `y' >>> from (irb):7 > > >> I wonder whether it's YAML-related. The YAML library defines >> Kernel#y. I'm not sure why you'd get that error message from it >> though, unless maybe AR hooks into it in some way. > > > I guess one part of my question was more along the lines of > > "is it a bug or a feature I don't understand, that > calling methods through "#send(:name)" vs ".name" > seem to find different methods" Certainly this: ruby -e 'def x; end; x; send(:x)' should never give you an ArgumentError, for any valid method name in place of x. If it does, there's a bug somewhere. If, however, something in your code, or code that yours loads, has changed things, such that you get that error, then it's not a bug. > Regarding the specifics of what weird stuff AR is doing, > would this be a good place to ask, or would the rails > mailing list be better? Maybe -- you could try both. David -- David A. Black dblack@wobblini.net