33件ヒット
[1-33件を表示]
(0.108秒)
検索結果
先頭4件
-
Proc
# parameters(lambda: nil) -> [object] (18216.0) -
Proc オブジェクトの引数の情報を返します。
...以下のような Symbol と、引数名を表す Symbol の 2 要素です。
: :req
必須の引数
: :opt
デフォルト値が指定されたオプショナルな引数
: :rest
* で指定された残りすべての引数
: :keyreq
必須のキーワード引数
: :key
デフォルト値......が指定されたオプショナルなキーワード引数
: :keyrest
** で指定された残りのキーワード引数
: :block
& で指定されたブロック引数
@param lambda true なら lambda として扱ったとき、false なら lambda ではない Proc として
扱......][ruby]{
prc = lambda{|x, y=42, *other, k_x:, k_y: 42, **k_other, &b|}
prc.parameters #=> x], [:opt, :y], [:rest, :other], [:keyreq, :k_x], [:key, :k_y], [:keyrest, :k_other], [:block, :b
//}
//emlist[lambda: の例][ruby]{
prc = proc{|x, y=42, *other|}
p prc.parameters # => x], [:opt, :y], [:rest... -
Method
# parameters -> [object] (18144.0) -
Method オブジェクトの引数の情報を返します。
...す。引数を取る場合は、配列の配列を返し、
各配列の要素は引数の種類に応じた以下のような Symbol と、仮引数の名前を表す Symbol の 2 要素です。
組み込みのメソッドでは、仮引数の名前が取れません。
: :req
必須の引数
:......keyreq
必須のキーワード引数
: :key
デフォルト値が指定されたオプショナルなキーワード引数
: :keyrest
** で指定された残りのキーワード引数
: :block
& で指定されたブロック引数
//emlist[例][ruby]{
m = Class.new{define_method(:m){|x, y=4......2, *other, k_x:, k_y: 42, **k_other, &b|}}.instance_method(:m)
m.parameters #=> x], [:opt, :y], [:rest, :other], [:keyreq, :k_x], [:key, :k_y], [:keyrest, :k_other], [:block, :b
File.method(:symlink).parameters #=> req
//}
@see Proc#parameters... -
Proc
# parameters -> [object] (18144.0) -
Proc オブジェクトの引数の情報を返します。
...以下のような Symbol と、引数名を表す Symbol の 2 要素です。
: :req
必須の引数
: :opt
デフォルト値が指定されたオプショナルな引数
: :rest
* で指定された残りすべての引数
: :keyreq
必須のキーワード引数
: :key
デフォルト値......数
: :keyrest
** で指定された残りのキーワード引数
: :block
& で指定されたブロック引数
//emlist[例][ruby]{
prc = lambda{|x, y=42, *other, k_x:, k_y: 42, **k_other, &b|}
prc.parameters #=> x], [:opt, :y], [:rest, :other], [:keyreq, :k_x], [:key, :k_y], [:keyrest, :k_o......ther], [:block, :b
//}
@see Method#parameters, UnboundMethod#parameters... -
Proc
# hash -> Integer (73.0) -
self のハッシュ値を返します。
...Symbol と、引数名を表す Symbol の 2 要素です。
//emlist[][ruby]{
prc = proc{|x, y=42, *other|}
p prc.parameters # => x], [:opt, :y], [:rest, :other
prc = lambda{|x, y=42, *other|}
p prc.parameters # => x], [:opt, :y], [:rest, :other
prc = proc{|x, y=42, *other|}
p prc.parameters(la......mbda: true) # => x], [:opt, :y], [:rest, :other
prc = lambda{|x, y=42, *other|}
p prc.parameters(lambda: false) # => x], [:opt, :y], [:rest, :other
//}...