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.



170
171
172
# File 'lib/aquarium/aspects/advice.rb', line 170

def initialize options = {}
  super options
end

Instance Method Details

#advice_wrapper(jp) ⇒ Object



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

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