Module: SimpleAspect

Defined in:
lib/simple_aspect.rb,
lib/simple_aspect/version.rb

Constant Summary collapse

VERSION =
'0.2.0'

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.extended(base) ⇒ Object



6
7
8
9
10
11
12
# File 'lib/simple_aspect.rb', line 6

def self.extended(base)
  base.instance_eval do
    @sa_methods_to_aspect_methods_name = {}
    @sa_ignoring_new_methods = false
    @sa_mutex = Mutex.new
  end
end

Instance Method Details

#aspect_around(method, instance_around_method_name = sa_instance_around_method_name(method), &block) ⇒ Object



14
15
16
17
18
19
20
# File 'lib/simple_aspect.rb', line 14

def aspect_around(
  method,
  instance_around_method_name = sa_instance_around_method_name(method),
  &block
)
  sa_register_aspect_on_method(method, instance_around_method_name, &block)
end

#method_added(method) ⇒ Object



22
23
24
25
26
# File 'lib/simple_aspect.rb', line 22

def method_added(method)
  return if sa_should_not_redefine?(method)

  sa_redefine_original_method(method, sa_get_aspect_method_name(method))
end