Added support to new callbacks for around filter object that respond to :before & :after

上级 bd7e3dc4
...@@ -311,6 +311,11 @@ def #{method_name} ...@@ -311,6 +311,11 @@ def #{method_name}
def #{method_name}(&blk) def #{method_name}(&blk)
if :#{kind} == :around && #{method_name}_object.respond_to?(:filter) if :#{kind} == :around && #{method_name}_object.respond_to?(:filter)
#{method_name}_object.send("filter", self, &blk) #{method_name}_object.send("filter", self, &blk)
# TODO: Deprecate this
elsif #{method_name}_object.respond_to?(:before) && #{method_name}_object.respond_to?(:after)
#{method_name}_object.before(self)
yield
#{method_name}_object.after(self)
else else
#{method_name}_object.send("#{kind}_#{name}", self, &blk) #{method_name}_object.send("#{kind}_#{name}", self, &blk)
end end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册