Method origin

Hello

[ I didnt expect a Fixnum::[] method ]

how can i see in which Class/Module a called method is (defined), and where
it has its origin? (Perhaps a list from originally defined to last
modification) method.super.class
Is an existing method to get the full ancestry?
(The path that .is_a checks, but also for methods)
e.g. Matrix.empty(2,0).sort.wherefrom

thank you
Berg

Matrix.empty(2,0).method(:sort).owner
=> Enumerable

Also, there's method(:blah).source_location, but it returns nil when method
is defined inside C extension.

For ex:

require 'time'
Time.method(:parse).source_location
=>
["/media/storage/home/zverok/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/time.rb",
359]

ยทยทยท

2016-04-10 15:10 GMT+03:00 A Berger <aberger7890@gmail.com>:

Hello

[ I didnt expect a Fixnum:: method ]

how can i see in which Class/Module a called method is (defined), and
where it has its origin? (Perhaps a list from originally defined to last
modification) method.super.class
Is an existing method to get the full ancestry?
(The path that .is_a checks, but also for methods)
e.g. Matrix.empty(2,0).sort.wherefrom

thank you
Berg

Unsubscribe: <mailto:ruby-talk-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk&gt;