るりまサーチ (Ruby 2.5.0)

最速Rubyリファレンスマニュアル検索!
2件ヒット [1-2件を表示] (0.197秒)
トップページ > バージョン:2.5.0[x] > 種類:インスタンスメソッド[x] > クエリ:r[x] > クエリ:d[x] > クエリ:source_location[x]

別のキーワード

  1. bigdecimal/util to_d
  2. float to_d
  3. rational to_d
  4. rsa d
  5. string to_d

ライブラリ

クラス

検索結果

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

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

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

その手続オブジェクトが ruby で定義されていない(つまりネイティブ
である)場合は nil を返します。

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

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

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

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

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

その手続オブジェクトが ruby で定義されていない(つまりネイティブ
である)場合は nil を返します。

@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...