Method_missing


#1

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? :slight_smile:

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

ciao robertj


#2

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