Skip to content

Instantly share code, notes, and snippets.

@lsegal
Created April 6, 2010 04:45
Show Gist options
  • Select an option

  • Save lsegal/357233 to your computer and use it in GitHub Desktop.

Select an option

Save lsegal/357233 to your computer and use it in GitHub Desktop.
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