class Aquarium::ClassWithStateAndBehavior
Constants
- STATE_CHANGE
Two alternative versions of the following pointcut would be
STATE_CHANGE
= pointcut :method => :state=STATE_CHANGE
= pointcut :attribute => :state, :attribute_options => [:writers] Note that only matching on the attribute writers is important, especially given the advice block below, because if the reader is allowed to be advised, we get an infinite recursion of advice invocation! The correct solution is the planned extension of the pointcut language to support condition tests for context. I.e., we don't want the advice applied when it's already inside advice.
Attributes
state[RW]
Public Class Methods
new(*args)
click to toggle source
# File examples/aspect_design_example.rb 17 def initialize *args 18 @state = args 19 p "Initializing: #{args.inspect}" 20 end