Find the Source File Where a Method Is Defined
<class_instance>.method(:<method_name>).source_location
Example:
> p "Hello World".method(:html_safe).source_location
["/<path_to_active_support>/core_ext/string/output_safety.rb", 183]
Written by Bui The Hoa
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Ruby
Authors
Related Tags
#ruby
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#