Created
July 1, 2014 12:01
-
-
Save jdibiccari/a2a43fa70b9172e5b9ab to your computer and use it in GitHub Desktop.
blog_post
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
#First call instance_method on a class to get hold of a method object | |
#We can then ask the method object where it is defined using source_location | |
location = Pond.instance_method(:cool_method).source_location | |
#=> ["/Users/JaneldiBiccari/Development/code/rails_labs/rails-blog-nested-resources-bk-001/app/models/post.rb", 9] | |
#Now open to that location | |
`subl #{location[0]}:#{location[1]}` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment