File tree 2 files changed +18
-0
lines changed
2 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -118,6 +118,9 @@ self[] の形の呼び出しは通常のメソッド呼び出しに見た目を
118
118
119
119
@param args self に渡される引数。
120
120
121
+ #@since 2.7.0
122
+ @see [[m:UnboundMethod#bind_call]]
123
+ #@end
121
124
@see [[d:spec/safelevel]]
122
125
#@# セーフレベルに関するその他の詳細
123
126
Original file line number Diff line number Diff line change @@ -99,6 +99,21 @@ NOTE: Ruby 1.8.xでモジュールのインスタンスメソッドをbindする
99
99
end
100
100
p m.bind(Bar.new) # => #<Method: Bar(Foo)#foo>
101
101
102
+ #@since 2.7.0
103
+ @see [[m:UnboundMethod#bind_call]]
104
+ --- bind_call(recv, *args) -> object
105
+ --- bind_call(recv, *args) { ... } -> object
106
+
107
+ self を recv に bind して args を引数として呼び出します。
108
+
109
+ self.bind(recv).call(*args) と同じ意味です。
110
+
111
+ #@samplecode
112
+ puts Kernel.instance_method(:inspect).bind_call(BasicObject.new) # => #<BasicObject:0x000055c65e8ea7b8>
113
+ #@end
114
+
115
+ @see [[m:UnboundMethod#bind]], [[m:Method#call]]
116
+ #@end
102
117
--- arity -> Integer
103
118
104
119
メソッドが受け付ける引数の数を返します。
You can’t perform that action at this time.
0 commit comments