種類
- インスタンスメソッド (42)
- 文書 (6)
ライブラリ
- ビルトイン (42)
クラス
- Method (24)
- UnboundMethod (18)
キーワード
- === (6)
-
NEWS for Ruby 2
. 7 . 0 (6) - [] (6)
- bind (6)
- call (12)
検索結果
先頭5件
-
UnboundMethod
# bind _ call(recv , *args) -> object (18108.0) -
self を recv に bind して args を引数として呼び出します。
...self を recv に bind して args を引数として呼び出します。
self.bind(recv).call(*args) と同じ意味です。
//emlist[][ruby]{
puts Kernel.instance_method(:inspect).bind_call(BasicObject.new) # => #<BasicObject:0x000055c65e8ea7b8>
//}
@see UnboundMethod#bind, Method#call... -
UnboundMethod
# bind _ call(recv , *args) { . . . } -> object (18108.0) -
self を recv に bind して args を引数として呼び出します。
...self を recv に bind して args を引数として呼び出します。
self.bind(recv).call(*args) と同じ意味です。
//emlist[][ruby]{
puts Kernel.instance_method(:inspect).bind_call(BasicObject.new) # => #<BasicObject:0x000055c65e8ea7b8>
//}
@see UnboundMethod#bind, Method#call... -
NEWS for Ruby 2
. 7 . 0 (18.0) -
NEWS for Ruby 2.7.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...含まれるようになりました。 15958
* UnboundMethod
* 新規メソッド
* UnboundMethod#bind_callが追加されました。 15955
* 「umethod.bind_call(obj, ...)」は「umethod.bind(obj).call(...)」と
同じ意味です。
このイディオム......rride
x + 2
end
end
obj = Bar.new
p obj.add_1(1) #=> 3
p Foo.instance_method(:add_1).bind(obj).call(1) #=> 2
p Foo.instance_method(:add_1).bind_call(obj, 1) #=> 2
//}
* Warning
* 新規メソッド
* Warning.[] とWarning.[]=がいくつかのカテゴリ化された
警... -
Method
# ===(*args) -> object (6.0) -
メソッドオブジェクトに封入されているメソッドを起動します。
...ような
他の [] メソッドとの意味的な関連性はありません。
@param args self に渡される引数。
@see UnboundMethod#bind_call
@see spec/safelevel
//emlist[例][ruby]{
class Foo
def foo(arg)
"foo called with arg #{arg}"
end
end
m = Foo.new.method(:foo) # => #<Me......ような
他の [] メソッドとの意味的な関連性はありません。
@param args self に渡される引数。
@see UnboundMethod#bind_call
//emlist[例][ruby]{
class Foo
def foo(arg)
"foo called with arg #{arg}"
end
end
m = Foo.new.method(:foo) # => #<Method: Foo#foo>
m[1]... -
Method
# [](*args) -> object (6.0) -
メソッドオブジェクトに封入されているメソッドを起動します。
...ような
他の [] メソッドとの意味的な関連性はありません。
@param args self に渡される引数。
@see UnboundMethod#bind_call
@see spec/safelevel
//emlist[例][ruby]{
class Foo
def foo(arg)
"foo called with arg #{arg}"
end
end
m = Foo.new.method(:foo) # => #<Me......ような
他の [] メソッドとの意味的な関連性はありません。
@param args self に渡される引数。
@see UnboundMethod#bind_call
//emlist[例][ruby]{
class Foo
def foo(arg)
"foo called with arg #{arg}"
end
end
m = Foo.new.method(:foo) # => #<Method: Foo#foo>
m[1]... -
Method
# call(*args) -> object (6.0) -
メソッドオブジェクトに封入されているメソッドを起動します。
...ような
他の [] メソッドとの意味的な関連性はありません。
@param args self に渡される引数。
@see UnboundMethod#bind_call
@see spec/safelevel
//emlist[例][ruby]{
class Foo
def foo(arg)
"foo called with arg #{arg}"
end
end
m = Foo.new.method(:foo) # => #<Me......ような
他の [] メソッドとの意味的な関連性はありません。
@param args self に渡される引数。
@see UnboundMethod#bind_call
//emlist[例][ruby]{
class Foo
def foo(arg)
"foo called with arg #{arg}"
end
end
m = Foo.new.method(:foo) # => #<Method: Foo#foo>
m[1]... -
Method
# call(*args) { . . . } -> object (6.0) -
メソッドオブジェクトに封入されているメソッドを起動します。
...ような
他の [] メソッドとの意味的な関連性はありません。
@param args self に渡される引数。
@see UnboundMethod#bind_call
@see spec/safelevel
//emlist[例][ruby]{
class Foo
def foo(arg)
"foo called with arg #{arg}"
end
end
m = Foo.new.method(:foo) # => #<Me......ような
他の [] メソッドとの意味的な関連性はありません。
@param args self に渡される引数。
@see UnboundMethod#bind_call
//emlist[例][ruby]{
class Foo
def foo(arg)
"foo called with arg #{arg}"
end
end
m = Foo.new.method(:foo) # => #<Method: Foo#foo>
m[1]... -
UnboundMethod
# bind(obj) -> Method (6.0) -
self を obj にバインドした Method オブジェクトを生成して返します。
..._method(:foo) # => #<UnboundMethod: Foo#foo>
# Foo をインクルードしたクラス Bar のインスタンスをレシーバと
# する Method オブジェクトを生成
class Bar
include Foo
end
p m.bind(Bar.new) # => #<Method: Bar(Foo)#foo>
//}
@see UnboundMethod#bind_call...