Ruby でメソッドがどこで定義されているか調べる方法

byebug で辿っても良いけど、これはこれで便利なのでメモ。

method(:byebug).source_location
#=> ["/Users/sinsoku/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/byebug-8.2.5/lib/byebug/attacher.rb", 29]

参考

class Method (Ruby 2.3.0)
http://docs.ruby-lang.org/ja/2.3.0/class/Method.html