るりまサーチ (Ruby 2.6.0)

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

別のキーワード

  1. _builtin raise
  2. kernel raise
  3. fiber raise
  4. thread raise
  5. e2mmap raise

ライブラリ

キーワード

検索結果

Enumerator::Lazy#take(n) -> Enumerator::Lazy (54442.0)

Enumerable#take と同じですが、配列ではなくEnumerator::Lazy を返します。

Enumerable#take と同じですが、配列ではなくEnumerator::Lazy を返します。

n が大きな数 (100000とか) の場合に備えて再定義されています。
配列が必要な場合は Enumerable#first を使って下さい。

@param n 要素数を指定します。

@raise ArgumentError n に負の数を指定した場合に発生します。

//emlist[例][ruby]{
1.step.lazy.take(5)
# => #<Enumerator::Lazy: #<Enumerator::Lazy: #<Enumerator: 1:step>>:...

Rinda::TupleSpaceProxy#take(tuple, sec = nil) -> Array | Hash (54412.0)

tuple にマッチするタプルをタプルスペースから取り出して返します。

tuple にマッチするタプルをタプルスペースから取り出して返します。

内部的にはリモートオブジェクトの Rinda::TupleSpace#take にフォワードされます。
詳細は Rinda::TupleSpace#take を参照してください。

@param tuple タプルのパターン
@param sec タイムアウト秒数
@raise Rinda::RequestExpiredError take がタイムアウトした場合に発生します
@raise Ridna::RequestCanceledError take が何らかの理由でキャンセルされた場合に発生します。

Rinda::TupleSpace#take(tuple, sec = nil) -> Array | Hash (54394.0)

tuple にマッチするタプルをタプルスペースから取り出して返します。

tuple にマッチするタプルをタプルスペースから取り出して返します。

tuple で指定できるパターンについては lib:rinda/rinda#tuplepattern を
参照してください。

マッチするタプルが存在しない場合は、マッチするタプルがタプルスペースに
投入されるまで待ちます。

sec でタイムアウト秒数を指定できます。
待ち時間が sec 秒を過ぎた時には take をあきらめ
例外 Rinda::RequestExpiredError を発生させます。
sec に nil を指定するとタイムアウトせずに無限に待ち続けます。

@param tuple タプルのパター...

rinda/rinda (127.0)

Rubyで実装されたタプルスペース(Tuple Space)を扱うためのライブラリです。

Rubyで実装されたタプルスペース(Tuple Space)を扱うためのライブラリです。

タプルスペースとは並列プログラムにおける一つのパターンです。
並列プログラミングにおいては、ロックのような同期処理が必須ですが、
適切な同期処理を実現することは困難をともないます。
このパターンにおいては、複数の並列単位(スレッド/プロセス)間の通信をすべて
タプルスペースという領域を経由して行います。これによって
プロセス間の通信トポロジーを単純化し、問題を簡単化します。
タプルスペースに対しては、タプルを書き込む(write)、取り出す(take)、
タプルの要素を覗き見る(read)
という操作の...

Enumerator::Lazy#collect {|item| ... } -> Enumerator::Lazy (37.0)

Enumerable#map と同じですが、配列ではなくEnumerator::Lazy を返します。

Enumerable#map と同じですが、配列ではなくEnumerator::Lazy を返します。

@raise ArgumentError ブロックを指定しなかった場合に発生します。

//emlist[例][ruby]{
1.step.lazy.map{ |n| n % 3 == 0 }
# => #<Enumerator::Lazy: #<Enumerator::Lazy: #<Enumerator: 1:step>>:map>

1.step.lazy.collect{ |n| n.succ }.take(10).force
# => [2, 3, 4, 5, 6, 7, 8,...

絞り込み条件を変える

Enumerator::Lazy#drop(n) -> Enumerator::Lazy (37.0)

Enumerable#drop と同じですが、配列ではなくEnumerator::Lazy を返します。

Enumerable#drop と同じですが、配列ではなくEnumerator::Lazy を返します。

@param n 要素数を指定します。

@raise ArgumentError n に負の数を指定した場合に発生します。

//emlist[例][ruby]{
1.step.lazy.drop(3)
# => #<Enumerator::Lazy: #<Enumerator::Lazy: #<Enumerator: 1:step>>:drop(3)>

1.step.lazy.drop(3).take(10).force
# => [4, 5, 6, 7, 8, 9, 10, 1...

Enumerator::Lazy#filter {|item| ... } -> Enumerator::Lazy (37.0)

Enumerable#select と同じですが、配列ではなくEnumerator::Lazy を返します。

Enumerable#select と同じですが、配列ではなくEnumerator::Lazy を返します。

@raise ArgumentError ブロックを指定しなかった場合に発生します。

//emlist[例][ruby]{
1.step.lazy.find_all { |i| i.even? }
# => #<Enumerator::Lazy: #<Enumerator::Lazy: #<Enumerator: 1:step>>:find_all>

1.step.lazy.select { |i| i.even? }.take(10).force
# => [2, 4, 6,...

Enumerator::Lazy#find_all {|item| ... } -> Enumerator::Lazy (37.0)

Enumerable#select と同じですが、配列ではなくEnumerator::Lazy を返します。

Enumerable#select と同じですが、配列ではなくEnumerator::Lazy を返します。

@raise ArgumentError ブロックを指定しなかった場合に発生します。

//emlist[例][ruby]{
1.step.lazy.find_all { |i| i.even? }
# => #<Enumerator::Lazy: #<Enumerator::Lazy: #<Enumerator: 1:step>>:find_all>

1.step.lazy.select { |i| i.even? }.take(10).force
# => [2, 4, 6,...

Enumerator::Lazy#map {|item| ... } -> Enumerator::Lazy (37.0)

Enumerable#map と同じですが、配列ではなくEnumerator::Lazy を返します。

Enumerable#map と同じですが、配列ではなくEnumerator::Lazy を返します。

@raise ArgumentError ブロックを指定しなかった場合に発生します。

//emlist[例][ruby]{
1.step.lazy.map{ |n| n % 3 == 0 }
# => #<Enumerator::Lazy: #<Enumerator::Lazy: #<Enumerator: 1:step>>:map>

1.step.lazy.collect{ |n| n.succ }.take(10).force
# => [2, 3, 4, 5, 6, 7, 8,...

Enumerator::Lazy#reject {|item| ... } -> Enumerator::Lazy (37.0)

Enumerable#reject と同じですが、配列ではなくEnumerator::Lazy を返します。

Enumerable#reject と同じですが、配列ではなくEnumerator::Lazy を返します。

@raise ArgumentError ブロックを指定しなかった場合に発生します。

//emlist[例][ruby]{
1.step.lazy.reject { |i| i.even? }
# => #<Enumerator::Lazy: #<Enumerator::Lazy: #<Enumerator: 1:step>>:reject>

1.step.lazy.reject { |i| i.even? }.take(10).force
# => [1, 3, 5, 7, ...

絞り込み条件を変える

Enumerator::Lazy#select {|item| ... } -> Enumerator::Lazy (37.0)

Enumerable#select と同じですが、配列ではなくEnumerator::Lazy を返します。

Enumerable#select と同じですが、配列ではなくEnumerator::Lazy を返します。

@raise ArgumentError ブロックを指定しなかった場合に発生します。

//emlist[例][ruby]{
1.step.lazy.find_all { |i| i.even? }
# => #<Enumerator::Lazy: #<Enumerator::Lazy: #<Enumerator: 1:step>>:find_all>

1.step.lazy.select { |i| i.even? }.take(10).force
# => [2, 4, 6,...