Method: Hooked::Aspect#call

Defined in:
lib/hooked/aspect.rb

#call(*args, &block) ⇒ Object



19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/hooked/aspect.rb', line 19

def call(*args, &block)
  advice.call(args, &block) if before?

  result = if around?
    advice.call pointcut, *args, &block
  else
    pointcut.call *args, &block
  end
  
  advice.call result if after?
  
  result
end