Created
February 14, 2013 11:41
-
-
Save benwoodward/4952286 to your computer and use it in GitHub Desktop.
Locate and open (in TextMate) at location of method source. http://pragmaticstudio.com/blog/2013/2/13/view-source-ruby-methods
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
# source_for(Person.new, :update) | |
def source_for(object, method) | |
location = object.method(method).source_location | |
`mate #{location[0]} -l #{location[1]}` | |
location | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment