Module: SimpleAspect
- Defined in:
- lib/simple_aspect.rb,
lib/simple_aspect/version.rb
Constant Summary collapse
- VERSION =
'0.2.1'
Class Method Summary collapse
- .extended(base) ⇒ Object private
Instance Method Summary collapse
-
#aspect_around(method, instance_around_method_name = sa_instance_around_method_name(method), &block) ⇒ Object
Register an aspect method around the target method.
- #method_added(method) ⇒ Object private
Class Method Details
.extended(base) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
7 8 9 10 11 12 13 |
# File 'lib/simple_aspect.rb', line 7 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
Register an aspect method around the target method
60 61 62 63 64 65 66 |
# File 'lib/simple_aspect.rb', line 60 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
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
69 70 71 72 73 |
# File 'lib/simple_aspect.rb', line 69 def method_added(method) return if sa_should_not_redefine?(method) sa_redefine_original_method(method, sa_get_aspect_method_name(method)) end |