3件ヒット
[1-3件を表示]
(0.053秒)
クラス
- Module (1)
- UnboundMethod (2)
キーワード
- owner (1)
-
source
_ location (1)
検索結果
先頭3件
-
Module
# instance _ method(name) -> UnboundMethod (54418.0) -
self のインスタンスメソッド name をオブジェクト化した UnboundMethod を返します。
self のインスタンスメソッド name をオブジェクト化した UnboundMethod を返します。
@param name メソッド名を Symbol または String で指定します。
@raise NameError self に存在しないメソッドを指定した場合に発生します。
@see Module#public_instance_method, Object#method
//emlist[例][ruby]{
class Interpreter
def do_a() print "there, "; end
def do_d() print "Hello ";... -
UnboundMethod
# owner -> Class | Module (364.0) -
このメソッドが定義されている class か module を返します。
このメソッドが定義されている class か module を返します。
//emlist[例][ruby]{
Integer.instance_method(:to_s).owner # => Integer
Integer.instance_method(:to_c).owner # => Numeric
Integer.instance_method(:hash).owner # => Kernel
//} -
UnboundMethod
# source _ location -> [String , Integer] | nil (346.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]
/...