るりまサーチ

最速Rubyリファレンスマニュアル検索!
12件ヒット [1-12件を表示] (0.030秒)
トップページ > クエリ:object[x] > クエリ:>[x] > クラス:Method[x] > クエリ:receiver[x]

別のキーワード

  1. objectspace each_object
  2. _builtin each_object
  3. object to_enum
  4. object enum_for
  5. object send

ライブラリ

検索結果

Method#receiver -> object (18327.0)

このメソッドオブジェクトのレシーバを返します。

...のメソッドオブジェクトのレシーバを返します。

//emlist[例][ruby]{
class Foo
def foo(arg)
"foo called with arg #{arg}"
end
end

m = Foo.new.method(:foo) # => #<Method: Foo#foo>
m.receiver # => #<Foo:0x007fb39203eb78>
m.receiver.foo(1) # => "foo called with arg 1"
//}...