From: Ray Baxter Date: 2008-05-17T12:25:02+09:00 Subject: Re: Object#select and method_missing --------------050307030106050403000500 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On May 16, 2008, at 6:21 PM, Bob Aman wrote: > class SelectTest > def method_missing(method, *params, &block) > return "Expected Result" if method == :select > super > end > > def test_one > self.select() > end > > def test_two > select() > end > end > puts SelectTest.new.test_one > puts SelectTest.new.test_two > > > Anyone care to explain why test_one calls method_missing and test_two > calls the private method Object#select? Object#select is a private method. Private methods cannot be called with an explicit receiver. Your call self.select has an explicit receiver. Sounds like there should be a special exception for when the receiver is self, but I could be missing something. Ray --------------050307030106050403000500--