Last active
February 25, 2019 05:08
-
-
Save jtzero/e755851b3cbda7159470d681a957f9c5 to your computer and use it in GitHub Desktop.
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
def const_source_location(const) | |
if method_name = const.instance_methods.sort.find {|m| const.instance_method(m).owner == const } | |
const.instance_method(method_name).source_location | |
else | |
raise "`#{const}' has no uninherited/mixed in instance methods" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment