るりまサーチ

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

別のキーワード

  1. matrix find_index
  2. _builtin find_index
  3. find find
  4. pathname find
  5. _builtin find_all

ライブラリ

モジュール

キーワード

検索結果

<< 1 2 > >>

Enumerable#find_all -> Enumerator (24221.0)

各要素に対してブロックを評価した値が真であった要素を全て含む配列を 返します。真になる要素がひとつもなかった場合は空の配列を返します。

...numerator を返します。

//emlist[例][ruby]{
(1..10).find_all # => #<Enumerator: 1..10:find_all>
(1..10).find_all { |i| i % 3 == 0 } # => [3, 6, 9]

[1,2,3,4,5].select # => #<Enumerator: [1, 2, 3, 4, 5]:select>
[1,2,3,4,5].select { |num| num.even...
...? } # => [2, 4]
//}

@see Enumerable#reject
@see Enumerable#grep...

Enumerable#find_all {|item| ... } -> [object] (24221.0)

各要素に対してブロックを評価した値が真であった要素を全て含む配列を 返します。真になる要素がひとつもなかった場合は空の配列を返します。

...numerator を返します。

//emlist[例][ruby]{
(1..10).find_all # => #<Enumerator: 1..10:find_all>
(1..10).find_all { |i| i % 3 == 0 } # => [3, 6, 9]

[1,2,3,4,5].select # => #<Enumerator: [1, 2, 3, 4, 5]:select>
[1,2,3,4,5].select { |num| num.even...
...? } # => [2, 4]
//}

@see Enumerable#reject
@see Enumerable#grep...

Enumerator::Lazy#find_all {|item| ... } -> Enumerator::Lazy (24214.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, 8, 10, 12, 14, 16, 18, 20]
//}

@see Enumerable#select...

Gem::GemPathSearcher#find_all(path) -> [Gem::Specification] (24208.0)

与えられたパスにマッチする Gem::Specification を全て返します。

...与えられたパスにマッチする Gem::Specification を全て返します。

@see Array#find_all...

Enumerable#find_all -> Enumerator (21221.0)

各要素に対してブロックを評価した値が真であった要素を全て含む配列を 返します。真になる要素がひとつもなかった場合は空の配列を返します。

...numerator を返します。

//emlist[例][ruby]{
(1..10).find_all # => #<Enumerator: 1..10:find_all>
(1..10).find_all { |i| i % 3 == 0 } # => [3, 6, 9]

[1,2,3,4,5].select # => #<Enumerator: [1, 2, 3, 4, 5]:select>
[1,2,3,4,5].select { |num| num.even...
...? } # => [2, 4]
//}

@see Enumerable#reject
@see Enumerable#grep...

絞り込み条件を変える

Enumerable#find_all {|item| ... } -> [object] (21221.0)

各要素に対してブロックを評価した値が真であった要素を全て含む配列を 返します。真になる要素がひとつもなかった場合は空の配列を返します。

...numerator を返します。

//emlist[例][ruby]{
(1..10).find_all # => #<Enumerator: 1..10:find_all>
(1..10).find_all { |i| i % 3 == 0 } # => [3, 6, 9]

[1,2,3,4,5].select # => #<Enumerator: [1, 2, 3, 4, 5]:select>
[1,2,3,4,5].select { |num| num.even...
...? } # => [2, 4]
//}

@see Enumerable#reject
@see Enumerable#grep...

Enumerator::Lazy#find_all {|item| ... } -> Enumerator::Lazy (21214.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, 8, 10, 12, 14, 16, 18, 20]
//}

@see Enumerable#select...

Enumerable#select -> Enumerator (6121.0)

各要素に対してブロックを評価した値が真であった要素を全て含む配列を 返します。真になる要素がひとつもなかった場合は空の配列を返します。

...numerator を返します。

//emlist[例][ruby]{
(1..10).find_all # => #<Enumerator: 1..10:find_all>
(1..10).find_all { |i| i % 3 == 0 } # => [3, 6, 9]

[1,2,3,4,5].select # => #<Enumerator: [1, 2, 3, 4, 5]:select>
[1,2,3,4,5].select { |num| num.even...
...? } # => [2, 4]
//}

@see Enumerable#reject
@see Enumerable#grep...

Enumerator::Lazy#select {|item| ... } -> Enumerator::Lazy (6114.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, 8, 10, 12, 14, 16, 18, 20]
//}

@see Enumerable#select...

Enumerable#select {|item| ... } -> [object] (6021.0)

各要素に対してブロックを評価した値が真であった要素を全て含む配列を 返します。真になる要素がひとつもなかった場合は空の配列を返します。

...numerator を返します。

//emlist[例][ruby]{
(1..10).find_all # => #<Enumerator: 1..10:find_all>
(1..10).find_all { |i| i % 3 == 0 } # => [3, 6, 9]

[1,2,3,4,5].select # => #<Enumerator: [1, 2, 3, 4, 5]:select>
[1,2,3,4,5].select { |num| num.even...
...? } # => [2, 4]
//}

@see Enumerable#reject
@see Enumerable#grep...

絞り込み条件を変える

Enumerable#filter -> Enumerator (3121.0)

各要素に対してブロックを評価した値が真であった要素を全て含む配列を 返します。真になる要素がひとつもなかった場合は空の配列を返します。

...numerator を返します。

//emlist[例][ruby]{
(1..10).find_all # => #<Enumerator: 1..10:find_all>
(1..10).find_all { |i| i % 3 == 0 } # => [3, 6, 9]

[1,2,3,4,5].select # => #<Enumerator: [1, 2, 3, 4, 5]:select>
[1,2,3,4,5].select { |num| num.even...
...? } # => [2, 4]
//}

@see Enumerable#reject
@see Enumerable#grep...

Enumerable#select -> Enumerator (3121.0)

各要素に対してブロックを評価した値が真であった要素を全て含む配列を 返します。真になる要素がひとつもなかった場合は空の配列を返します。

...numerator を返します。

//emlist[例][ruby]{
(1..10).find_all # => #<Enumerator: 1..10:find_all>
(1..10).find_all { |i| i % 3 == 0 } # => [3, 6, 9]

[1,2,3,4,5].select # => #<Enumerator: [1, 2, 3, 4, 5]:select>
[1,2,3,4,5].select { |num| num.even...
...? } # => [2, 4]
//}

@see Enumerable#reject
@see Enumerable#grep...

Enumerator::Lazy#filter {|item| ... } -> Enumerator::Lazy (3114.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, 8, 10, 12, 14, 16, 18, 20]
//}

@see Enumerable#select...

Enumerator::Lazy#select {|item| ... } -> Enumerator::Lazy (3114.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, 8, 10, 12, 14, 16, 18, 20]
//}

@see Enumerable#select...

Enumerable#lazy -> Enumerator::Lazy (3107.0)

自身を lazy な Enumerator に変換したものを返します。

...lazy な Enumerator に変換したものを返します。

この Enumerator は、以下のメソッドが遅延評価を行う (つまり、配列ではな
くEnumeratorを返す) ように再定義されています。

* map/collect
* flat_map/collect_concat
* select/find_all
* reject
*...
...][ruby]{
def pythagorean_triples
(1..Float::INFINITY).lazy.flat_map {|z|
(1..z).flat_map {|x|
(x..z).select {|y|
x**2 + y**2 == z**2
}.map {|y|
[x, y, z]
}
}
}
end
# 最初の10個のピタゴラス数を表示する
p pythagorean_triples.take(10).force...
...# takeはlazyなので、forceが必要です
p pythagorean_triples.first(10) # firstはeagerです
# 100より小さいピタゴラス数を表示する
p pythagorean_triples.take_while { |*, z| z < 100 }.force
//}

@see Enumerator::Lazy...

絞り込み条件を変える

Enumerable#filter {|item| ... } -> [object] (3021.0)

各要素に対してブロックを評価した値が真であった要素を全て含む配列を 返します。真になる要素がひとつもなかった場合は空の配列を返します。

...numerator を返します。

//emlist[例][ruby]{
(1..10).find_all # => #<Enumerator: 1..10:find_all>
(1..10).find_all { |i| i % 3 == 0 } # => [3, 6, 9]

[1,2,3,4,5].select # => #<Enumerator: [1, 2, 3, 4, 5]:select>
[1,2,3,4,5].select { |num| num.even...
...? } # => [2, 4]
//}

@see Enumerable#reject
@see Enumerable#grep...
<< 1 2 > >>