Created
April 6, 2010 04:45
-
-
Save lsegal/357233 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
| require 'yard' | |
| class DefineMethodHandler < YARD::Handlers::Ruby::Base | |
| handles method_call(:define_method) | |
| process { register MethodObject.new(namespace, statement[1].jump(:ident)[0]) } | |
| end | |
| YARD.parse_string(<<-'eof') | |
| class Foo | |
| def self.something | |
| define_method(:foo) do | |
| blah | |
| end | |
| end | |
| end | |
| eof | |
| puts YARD::Registry.all(:method).find {|m| m.name == :foo }.source |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment