Class: Aspect
- Inherits:
-
Module
- Object
- Module
- Aspect
- Defined in:
- lib/cuts/aop.rb
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.
24 25 26 27 |
# File 'lib/cuts/aop.rb', line 24 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)
35 36 37 |
# File 'lib/cuts/aop.rb', line 35 def join(name, &block) (points[name] ||= []) << block end |
#points ⇒ Object
29 30 31 |
# File 'lib/cuts/aop.rb', line 29 def points @points ||= {} end |