Class: Aspect
Overview
Aspect Oriented Programming for Ruby using Cuts.
Instance Method Summary collapse
-
#initialize(&block) ⇒ Aspect
constructor
A new instance of Aspect.
-
#join(name, &block) ⇒ Object
TODO Should this accept pattern matches as an alternative to the block too? Eg.
- #points ⇒ Object
Constructor Details
#initialize(&block) ⇒ Aspect
Returns a new instance of Aspect.
11 12 13 14 |
# File 'lib/cuts/aop.rb', line 11 def initialize(&block) instance_eval(&block) extend self end |
Instance Method Details
#join(name, &block) ⇒ Object
TODO Should this accept pattern matches as an alternative to the block too?
Eg. join(name, pattern=nil, &block)
22 23 24 |
# File 'lib/cuts/aop.rb', line 22 def join(name, &block) (points[name] ||= []) << block end |
#points ⇒ Object
16 17 18 |
# File 'lib/cuts/aop.rb', line 16 def points @points ||= {} end |