Class: Aspect

Inherits:
Module
  • Object
show all
Defined in:
lib/cuts/aop.rb

Instance Method Summary collapse

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

#pointsObject



29
30
31
# File 'lib/cuts/aop.rb', line 29

def points
  @points ||= {}
end