more a workaround than a real solution (you asked for a method), but I would recommend using ri doc . If the Rdoc / Ri Doc was correctly generated, the original stone is mentioned in the document.
to list all classes known as ri:
ri -l
To get a document for a specific class or module:
ri ClassName
to get information about the method:
ri ClassName#instance_method_name ri ClassName#class_method_name
If you want, there is a gem called ri_for , which allows you to check the ri document at runtime, which will help you in the console. Example output for an irb session:
>> require 'ri_for' => true >> String.desc_class begin RI String < Object ------------------------------------------------------------------------------ Includes: Diff::LCS (from gem diff-lcs-1.1.3) (from gem diff-lcs-1.1.3) ------------------------------------------------------------------------------ Includes Diff::LCS into String. ------------------------------------------------------------------------------ (from gem rake-0.8.7) ------------------------------------------------------------------------------ User defined methods to be added to String. ------------------------------------------------------------------------------ Instance methods: ext pathmap pathmap_explode pathmap_partial pathmap_replace (from gem treetop-1.4.10) ------------------------------------------------------------------------------ Instance methods: blank? column_of indent line_of tabto treetop_camelize end ri String non inherited methods: %, *, +, <<, <=>, ==, ===, =~, [], []=, ascii_only?, blank?, bytes, bytesize, capitalize, capitalize!, casecmp, center, chars, chomp, chomp!, chop, chop!, chr, clear, codepoints, column_of, concat, count, crypt, delete, delete!, downcase, downcase!, dump, each_byte, each_char, each_codepoint, each_line, empty?, encode, encode!, encoding, end_with?, eql?, force_encoding, getbyte, gsub, gsub!, hash, hex, include?, indent, index, insert, inspect, intern, length, line_of, lines, ljust, lstrip, lstrip!, match, next, next!, oct, ord, partition, replace, reverse, reverse!, rindex, rjust, rpartition, rstrip, rstrip!, scan, setbyte, size, slice, slice!, split, squeeze, squeeze!, start_with?, strip, strip!, sub, sub!, succ, succ!, sum, swapcase, swapcase!, tabto, to_c, to_f, to_i, to_r, to_s, to_str, to_sym, tr, tr!, tr_s, tr_s!, treetop_camelize, unpack, upcase, upcase!, upto, valid_encoding? non inherited class methods: try_convert => nil