るりまサーチ

最速Rubyリファレンスマニュアル検索!
24件ヒット [1-24件を表示] (0.130秒)

別のキーワード

  1. kernel require
  2. getoptlong require_order
  3. irb/ext/use-loader irb_require
  4. rubygems/custom_require require
  5. kernel require_relative

ライブラリ

クラス

検索結果

UnboundMethod#source_location -> [String, Integer] | nil (24238.0)

ソースコードのファイル名と行番号を配列で返します。

...nil を返します。

//emlist[例][ruby]{
require
'time'

T
ime.instance_method(:zone).source_location # => nil
T
ime.instance_method(:httpdate).source_location # => ["/Users/user/.rbenv/versions/2.4.3/lib/ruby/2.4.0/time.rb", 654]
//}

@
see Proc#source_location, Method#source_location...

Method#source_location -> [String, Integer] | nil (24232.0)

ソースコードのファイル名と行番号を配列で返します。

...す。

@
see Proc#source_location

//emlist[例][ruby]{
# ------- /tmp/foo.rb ---------
class Foo
def foo; end
end
# ----- end of /tmp/foo.rb ----

require
'/tmp/foo'

m = Foo.new.method(:foo) # => #<Method: Foo#foo>
m.source_location # => ["/tmp/foo.rb", 2]

method(:puts).source_location # => nil...