[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

method_missing

robertj

3/6/2006 10:06:00 PM

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

1 Answer

Daniel Amelang

3/6/2006 10:52:00 PM

0

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

On 3/6/06, robertj <robert_kuzelj@yahoo.com> wrote:
> 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
>
>
>