Ray Baxter
5/17/2008 3:25:00 AM
[Note: parts of this message were removed to make it a legal post.]
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