[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.lang.ruby

question about rite

Luke Graham

2/17/2005 2:33:00 AM

Will there be a way to get a function called on -every-
possible method call, or will we just have to do ..

ObjectSpace.each(Class) { |c|
methods.each { |m|
eval """
class #{c.to_s}
def #{m}:pre(*args)
puts \"pre for #{c.to_s}::#{m}\"
end
end
"""
}
}

AFAIK the AOP guys still have to list every function
they want wrapped...?

--
spooq


3 Answers

Yukihiro Matsumoto

2/17/2005 4:26:00 AM

0

Hi,

In message "Re: question about rite"
on Thu, 17 Feb 2005 11:33:15 +0900, Luke Graham <spoooq@gmail.com> writes:

|Will there be a way to get a function called on -every-
|possible method call, or will we just have to do ..

I feel like that wild card wrapping is not common enough to support
explicitly.

matz.


Luke Graham

2/18/2005 1:26:00 AM

0

Thank you for your quick answer. Next time Im in Japan,
I would like to buy you a beer to say thank you for Ruby :)


On Thu, 17 Feb 2005 13:26:17 +0900, Yukihiro Matsumoto
<matz@ruby-lang.org> wrote:
> Hi,
>
> In message "Re: question about rite"
> on Thu, 17 Feb 2005 11:33:15 +0900, Luke Graham <spoooq@gmail.com> writes:
>
> |Will there be a way to get a function called on -every-
> |possible method call, or will we just have to do ..
>
> I feel like that wild card wrapping is not common enough to support
> explicitly.
>
> matz.
>
>


--
spooq


Yukihiro Matsumoto

2/18/2005 2:57:00 AM

0

Hi,

In message "Re: question about rite"
on Fri, 18 Feb 2005 10:25:44 +0900, Luke Graham <spoooq@gmail.com> writes:

|Thank you for your quick answer. Next time Im in Japan,
|I would like to buy you a beer to say thank you for Ruby :)

Thank you. Soft drink is good enough, since I don't drink.

matz.