Message from discussion
preventing Object#send from dispatching to a global method?
Path: g2news1.google.com!news3.google.com!news2.google.com!proxad.net!proxad.net!feeder2.cambrium.nl!feed.tweaknews.nl!193.141.40.68.MISMATCH!npeer.de.kpn-eurorings.net!noris.net!not-for-mail
From: Francis Hwang <s...@fhwang.net>
Newsgroups: comp.lang.ruby
Subject: preventing Object#send from dispatching to a global method?
Date: Sun, 29 May 2005 00:42:46 +0900
Lines: 20
Message-ID: <817f2ed1ec1e7d2fee99c984c4815807@fhwang.net>
NNTP-Posting-Host: sinus.lauschmusik.de
Content-Type: text/plain; charset=US-ASCII; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: ork-un.noris.net 1117294988 5700 213.95.32.201 (28 May 2005 15:43:08 GMT)
X-Complaints-To: news@noris.net
NNTP-Posting-Date: Sat, 28 May 2005 15:43:08 +0000 (UTC)
X-received-from: This message has been automatically forwarded from
the ruby-talk mailing list by a gateway at lauschmusik.de. If it is
SPAM, it did not originate at lauschmusik.de. Please report the
original sender, and not us. Thanks!
Please see http://hypermetrics.com/rubyhacker/clrFAQ.html#tag24 to.
X-ML-Name: ruby-talk
X-Mail-Count: 143884
X-ruby-talk: <817f2ed1ec1e7d2fee99c984c4815...@fhwang.net>
X-rubymirror: yes
Is there a way to prevent Object#send from dispatching to a global
method? By which I mean:
def something; end
class SomeClass
def method_missing( sym, *args ) .... do magic; end
end
SomeClass.new.something # I'd like this to go to
SomeClass#method_missing, not Kernel#something
I can manage this other ways, but I'd love to use something like send,
if possible.
Francis Hwang
http://fhwang.net/