Class: Module

Inherits:
Object
  • Object
show all
Defined in:
lib/cuts/aop.rb,
lib/cuts/cut.rb

Direct Known Subclasses

Aspect, Cut

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#cross_cut ⇒ Object (readonly)

The cut that carries this class's aspects, if any have been applied.



239
240
241
# File 'lib/cuts/aop.rb', line 239

def cross_cut
  @cross_cut
end

Instance Method Details

#apply(aspect) ⇒ Object

Apply an aspect to this class.



242
243
244
245
246
247
# File 'lib/cuts/aop.rb', line 242

def apply(aspect)
  @cross_cut ||= CrossCut.new(self)
  aspects.unshift(aspect)
  @cross_cut.reset
  self
end

#aspects ⇒ Object

The aspects applied to this class, the newest first.



236
# File 'lib/cuts/aop.rb', line 236

def aspects; @aspects ||= []; end

#cuts ⇒ Object

The cuts of this class or module, the newest first, which is the order in which they are called.



107
108
109
# File 'lib/cuts/cut.rb', line 107

def cuts
  @cuts ||= []
end