더 실제 솔루션 (당신이 방법을 요구)보다 해결,하지만 난 ri doc을 사용할 것을 권장합니다. Rdoc/Ri Doc가 적절히 생성되면, doc은 소스 젬을 언급합니다.
ri ClassName#instance_method_name
ri ClassName#class_method_name
:
ri ClassName
이 방법에 대한 정보를 얻을 수 :
ri -l
가 특정 클래스 또는 모듈에 문서를 얻을 :
은 RI에 의해 알려진 모든 클래스를 나열하려면 원하는 경우
ri_for이라는 보석이있어서
ri
문서를 검사 할 수 있습니다. 런타임에는 콘솔에서 도움이 될 것입니다. IRB 세션에 대한 출력의 예 :
>> 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
그는'ri_for' 보석의 모든 기능을 가진 Pry를 이미 사용하고 있습니다. – horseyguy
멋진 것들. 치어 리더에 대해 몰랐다. –