Forum: Ruby method_missing

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
robertj (Guest)
on 2006-03-07 00:09
(Received via mailing list)
hi,

is there a way to find out if a method was called using parens or not.
that is there some hidden parameter that tells me

someinstance.foo

or

someinstance.foo()

maybe the ruby docs is missing the following? :-)

def method_missing(_id, [very_secret_flag_for_parens], *_args, &_block)

ciao robertj
Daniel A. (Guest)
on 2006-03-07 00:52
(Received via mailing list)
Nope. I guess you could walk up the backtrace, get the file and line
number and parse it out of the code where you're method was called.
I'd wouldn't recommend that, for various reasons.

So, as far as I know, no. Sorry.

Dan Amelang
This topic is locked and can not be replied to.