lib/yard/handlers/base.rb in yard-0.5.3 vs lib/yard/handlers/base.rb in yard-0.5.4

- old
+ new

@@ -201,9 +201,22 @@ end def namespace_only? @namespace_only ? true : false end + + # Generates a +process+ method, equivalent to +def process; ... end+. + # Blocks defined with this syntax will be wrapped inside an anonymous + # module so that the handler class can be extended with mixins that + # override the +process+ method without alias chaining. + # + # @see #process + # @return [void] + def process(&block) + mod = Module.new + mod.send(:define_method, :process, &block) + include mod + end end def initialize(source_parser, stmt) @parser = source_parser @statement = stmt \ No newline at end of file