るりまサーチ (Ruby 2.4.0)

最速Rubyリファレンスマニュアル検索!
1件ヒット [1-1件を表示] (0.009秒)
トップページ > クラス:UnboundMethod[x] > バージョン:2.4.0[x] > クエリ:arity[x] > 種類:インスタンスメソッド[x]

別のキーワード

  1. _builtin arity
  2. proc arity
  3. method arity
  4. unboundmethod arity

ライブラリ

検索結果

UnboundMethod#arity -> Integer (54490.0)

メソッドが受け付ける引数の数を返します。

メソッドが受け付ける引数の数を返します。

ただし、メソッドが可変長引数を受け付ける場合、負の整数
-(必要とされる引数の数 + 1)
を返します。C 言語レベルで実装されたメソッドが可変長引数を
受け付ける場合、-1 を返します。

//emlist[例][ruby]{
class C
def one; end
def two(a); end
def three(*a); end
def four(a, b); end
def five(a, b, *c); end
def six(a, b, *c, &d); end
end

p C.insta...