Class: AfterDo::Loader::AspectApplier

Inherits:
Object
  • Object
show all
Defined in:
lib/after_do/loader/aspect_applier.rb

Instance Method Summary collapse

Constructor Details

#initialize(aspect) ⇒ AspectApplier

Returns a new instance of AspectApplier.



4
5
6
# File 'lib/after_do/loader/aspect_applier.rb', line 4

def initialize(aspect)
  @aspect = aspect
end

Instance Method Details

#applyObject



8
9
10
11
12
13
14
15
16
17
18
# File 'lib/after_do/loader/aspect_applier.rb', line 8

def apply
  aspect.advices.each do |advice|
    advice.targets.each do |target|
      target.klass.each do |target_klass|
        extend_and_apply(
          target_klass, target.target_methods, aspect, advice
        )
      end
    end
  end
end