Hi zimbatm
Thanks for your reply. At least I know the mails are getting some place --
For some reason it my mail isn't coming to me :-o
I wasn't really expecting an "AOP" there is an example on the wtf about
pre- and post- trigger code. When I wrote a small dumb example it didn't
work. I made it even dumber. Then a really really dumb example.
I have not managed to get a puts to print something from a call-back. That
includes the tc_aspects.rb
I added two puts commands to the pre_, post_ methods. Neither print
happens.
I am most interested in some instructions or guide that tells me the
semantics for the hashes. Because what I thought was happening, just does
not do it for me. So as you see I haven't' really got onto any expectancy
of aop so far.
One point for clarity, I'm happy if the test does what the test is supposed
to do. At this point, I want to 'get' the semantics and possibly the syntax
for doing "this it". (It is not doing a thing I could reasonably expect
given the comments in the code.)
Cheers,
Will.
_____
viz.
$/ruby\lib\ruby\gems\1.8\gems\glue-0.30.0-\test\glue\tc_aspects.rb
def pre_advice
puts "pre_advice"
@b = 1
@a += 1
end
def post_advice
puts "put_advice"
@c = 1
end
-----Original Message-----
From: Jonas Pfenniger [mailto:zimba.tm at gmail.com]
Sent: Tuesday, 27 June 2006 20:48
To: william.full.moon at gmail.com; General discussion about Nitro
Subject: Re: [Nitro] Who knows aspects?
Importance: Low
Hi,
Glue::Aspects is not a real AOP Aspect. Instead, the class has to define
interceptable methods.
og/store/sql.rb defines pre and post methods for og_insert, og_update,
og_read and og_delete
you can use it like that :
class User
before :check_something, :on => [:og_read, :og_insert]
private
def check_something
#...
end
end
--
Cheers,
zimbatm
http://zimbatm.oree.ch
--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.394 / Virus Database: 268.9.5/377 - Release Date: 27-Jun-2006