るりまサーチ

最速Rubyリファレンスマニュアル検索!
19753件ヒット [13701-13800件を表示] (0.094秒)

モジュール

キーワード

検索結果

<< < ... 136 137 138 139 140 ... > >>

Proc#hash -> Integer (3.0)

self のハッシュ値を返します。

self のハッシュ値を返します。



Proc オブジェクトの引数の情報を返します。

Proc オブジェクトが引数を取らなければ空の配列を返します。引数を取る場合は、配列の配列を返し、
各配列の要素は引数の種類に対応した以下のような 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.param...

Proc#inspect -> String (3.0)

self の文字列表現を返します。

self の文字列表現を返します。

可能なら self を生成したソースファイル名、行番号を含みます。

//emlist[例][ruby]{
p Proc.new {
true
}.to_s

# => "#<Proc:0x0x401a880c@-:3>"
//}

Proc#lambda? -> bool (3.0)

手続きオブジェクトの引数の取扱が厳密であるならば true を返します。

手続きオブジェクトの引数の取扱が厳密であるならば true を返します。


引数の取扱の厳密さの意味は以下の例を参考にしてください。

//emlist[例][ruby]{
# lambda で生成した Proc オブジェクトでは true
lambda{}.lambda? # => true
# proc で生成した Proc オブジェクトでは false
proc{}.lambda? # => false
# Proc.new で生成した Proc オブジェクトでは false
Proc.new{}.lambda? # => false

# 以下、lambda?が偽である場合
#...

Proc#parameters -> [object] (3.0)

Proc オブジェクトの引数の情報を返します。

Proc オブジェクトの引数の情報を返します。

Proc オブジェクトが引数を取らなければ空の配列を返します。引数を取る場合は、配列の配列を返し、
各配列の要素は引数の種類に対応した以下のような Symbol と、引数名を表す Symbol の 2 要素です。

: :req
必須の引数
: :opt
デフォルト値が指定されたオプショナルな引数
: :rest
* で指定された残りすべての引数
: :keyreq
必須のキーワード引数
: :key
デフォルト値が指定されたオプショナルなキーワード引数
: :keyrest
** で指定された残りのキーワード引数
: :block...

Proc#parameters(lambda: nil) -> [object] (3.0)

Proc オブジェクトの引数の情報を返します。

Proc オブジェクトの引数の情報を返します。

Proc オブジェクトが引数を取らなければ空の配列を返します。引数を取る場合は、配列の配列を返し、
各配列の要素は引数の種類に対応した以下のような Symbol と、引数名を表す Symbol の 2 要素です。

: :req
必須の引数
: :opt
デフォルト値が指定されたオプショナルな引数
: :rest
* で指定された残りすべての引数
: :keyreq
必須のキーワード引数
: :key
デフォルト値が指定されたオプショナルなキーワード引数
: :keyrest
** で指定された残りのキーワード引数
: :block...

絞り込み条件を変える

Proc#ruby2_keywords -> proc (3.0)

Marks the proc as passing keywords through a normal argument splat. This should only be called on procs that accept an argument splat (`*args`) but not explicit keywords or a keyword splat. It marks the proc such that if the proc is called with keyword arguments, the final hash argument is marked with a special flag such that if it is the final element of a normal argument splat to another method call, and that method call does not include explicit keywords or a keyword splat, the final element is interpreted as keywords. In other words, keywords will be passed through the proc to other methods.

Marks the proc as passing keywords through a normal argument splat. This
should only be called on procs that accept an argument splat (`*args`)
but not explicit keywords or a keyword splat. It marks the proc such
that if the proc is called with keyword arguments, the final hash
argument is marked ...

Proc#source_location -> [String, Integer] | nil (3.0)

ソースコードのファイル名と行番号を配列で返します。

ソースコードのファイル名と行番号を配列で返します。

その手続オブジェクトが ruby で定義されていない(つまりネイティブ
である)場合は nil を返します。


//emlist[例][ruby]{
# /path/to/target.rb を実行
proc {}.source_location # => ["/path/to/target.rb", 1]
proc {}.source_location # => ["/path/to/target.rb", 2]
(eval "proc {}").source_location # => ...

Proc#to_proc -> self (3.0)

self を返します。

self を返します。

//emlist[例][ruby]{
pr = proc {}
p pr == pr.to_proc # => true
//}

Proc#to_s -> String (3.0)

self の文字列表現を返します。

self の文字列表現を返します。

可能なら self を生成したソースファイル名、行番号を含みます。

//emlist[例][ruby]{
p Proc.new {
true
}.to_s

# => "#<Proc:0x0x401a880c@-:3>"
//}

Proc#yield(*arg) -> () (3.0)

手続きオブジェクトを実行してその結果を返します。

手続きオブジェクトを実行してその結果を返します。

引数の渡され方はオブジェクトの生成方法によって異なります。
詳しくは Proc#lambda? を参照してください。

「===」は when の所に手続きを渡せるようにするためのものです。

//emlist[例][ruby]{
def sign(n)
case n
when lambda{|n| n > 0} then 1
when lambda{|n| n < 0} then -1
else 0
end
end

p sign(-4) #=> -1
p sign(0) #=> 0
p sign(7) #=> 1...

絞り込み条件を変える

Process::Status#&(other) -> Integer (3.0)

self.to_i & other と同じです。 このメソッドは後方互換性のためにあります。

self.to_i & other と同じです。
このメソッドは後方互換性のためにあります。

@param other 自身との & 演算をしたい整数を指定します。

Process::Status#==(other) -> bool (3.0)

同じステータスの場合に真を返します。

同じステータスの場合に真を返します。

other が数値の場合、self.to_i との比較が行われます。こ
れは後方互換性のためです。

@param other 自身と比較したいオブジェクトを指定します。
<< < ... 136 137 138 139 140 ... > >>