2件ヒット
[1-2件を表示]
(0.225秒)
検索結果
-
Method
# receiver -> object (78340.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"
//} -
Binding
# receiver -> object (78304.0) -
保持するコンテキスト内での self を返します。
保持するコンテキスト内での self を返します。
このメソッドは以下のコードと同様の動作をします。
//emlist[][ruby]{
binding.eval("self")
//}