Skip to content

Instantly share code, notes, and snippets.

@deevis
Created July 18, 2013 17:15
Show Gist options
  • Save deevis/6031108 to your computer and use it in GitHub Desktop.
Save deevis/6031108 to your computer and use it in GitHub Desktop.
Get source location of all defined methods (or instance_methods) for a given Class
#Get source location of all defined methods (or instance_methods) for a given Class
klazz=String
type=:instance_method # type=:method
klazz.send(type.to_s.pluralize.to_sym,false).sort.map{|m| [m,klazz.send(type,m).source_location]}.select{|x| x[1]}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment