Created
May 13, 2014 05:35
-
-
Save jemc/898351a8d4f488a8346a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MyDecoratorHandler < YARD::Handlers::Ruby::Base | |
handles method_call(:my_decorator) | |
# my_decorator {meta:'data'}, def foo(a,b,c); end | |
def process | |
args = statement[1] | |
mdef = args[1] | |
metadata = args[0].source.gsub /[\r\n]/, '' | |
mdef.docstring = statement.docstring + ['', | |
"@note Decorator metadata: #{metadata}", | |
].join("\n") | |
parse_block mdef | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment