Last Updated: February 25, 2016
·
324
· buithehoa

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]