Class: Aquarium::Aspects::BeforeAdviceChainNode

Inherits:
AdviceChainNode show all
Defined in:
lib/aquarium/aspects/advice.rb

Constant Summary

Constants inherited from AdviceChainNode

AdviceChainNode::NIL_OBJECT

Instance Method Summary collapse

Methods inherited from AdviceChainNode

#call, #call_advice, #each, #empty?, #invoke_original_join_point, #last, #size

Constructor Details

#initialize(options = {}) ⇒ BeforeAdviceChainNode

Returns a new instance of BeforeAdviceChainNode.



168
169
170
# File 'lib/aquarium/aspects/advice.rb', line 168

def initialize options = {}
  super options 
end

Instance Method Details

#advice_wrapper(jp) ⇒ Object



171
172
173
174
175
176
177
# File 'lib/aquarium/aspects/advice.rb', line 171

def advice_wrapper jp
  update_current_context jp
  jp.context.advice_kind = :before
  call_advice jp
  reset_current_context jp
  next_node.call jp
end