lib/aspect4r/base.rb in aspect4r-0.8.0 vs lib/aspect4r/base.rb in aspect4r-0.8.1
- old
+ new
@@ -34,8 +34,27 @@
if block_given?
yield
a4r_data.change_group
end
end
+
+ def a4r_disable_advices_temporarily *methods
+ methods.each do |method|
+ advices = a4r_data[method.to_sym]
+ next if advices.nil? or advices.empty?
+
+ Aspect4r::Helper.define_method self, method, advices.wrapped_method
+ end
+
+ yield
+ ensure
+ methods.each do |method|
+ advices = a4r_data[method.to_sym]
+
+ next if advices.nil? or advices.empty?
+
+ Aspect4r::Helper.create_method self, method
+ end
+ end
end
end
end
\ No newline at end of file