Class Aquarium::ClassWithStateAndBehavior
In: examples/aspect_design_example.rb
examples/aspect_design_example_spec.rb
Parent: Object

Methods

new   new  

Included Modules

Aquarium::DSL Aquarium::DSL

Constants

STATE_CHANGE = pointcut :writing => :state   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.
STATE_CHANGE = pointcut :writing => :state   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] 
state  [RW] 

Public Class methods

[Source]

    # File examples/aspect_design_example.rb, line 16
16:     def initialize *args
17:       @state = args
18:       p "Initializing: #{args.inspect}"
19:     end

[Source]

    # File examples/aspect_design_example_spec.rb, line 15
15:     def initialize *args
16:       @state = args
17:     end

[Validate]