Created
July 18, 2013 17:15
-
-
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
This file contains 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
#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