From: David Heinemeier Hansson Date: 2004-06-16T04:48:57+09:00 Subject: Re: method_missing and send > I'm still a bit puzzled as to why 'obj.send(:msg)' should behave > differently > from 'obj.msg'. My impression was that they are different ways of > expressing > the same concept - sending a message to an object. That's why I > expected the > same result from either call. > > Does anyone else think this odd or even in violation of the principle > of > least surprise? I too found it odd, but very convenient. By using obj#send, you also get to sidestep the encapsulation support. So it's possible to call protected and private methods this way. That might be considered in violation of POLS, but it's pretty darn useful in those edge cases where you really do want to, knowingly, sidestep encapsulation. -- David Heinemeier Hansson, http://www.instiki.org/ -- A No-Step-Three Wiki in Ruby http://www.basecamphq.com/ -- Web-based Project Management http://www.loudthinking.com/ -- Broadcasting Brain http://www.nextangle.com/ -- Development & Consulting Services