るりまサーチ

最速Rubyリファレンスマニュアル検索!
501件ヒット [201-300件を表示] (0.219秒)
トップページ > クエリ:_builtin[x] > クエリ:select[x] > 種類:インスタンスメソッド[x]

別のキーワード

  1. _builtin new
  2. _builtin inspect
  3. _builtin []
  4. _builtin to_s
  5. _builtin each

ライブラリ

クラス

モジュール

キーワード

検索結果

<< < 1 2 3 4 5 ... > >>

Enumerator::Lazy#filter {|item| ... } -> Enumerator::Lazy (8030.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#find_all {|item| ... } -> Enumerator::Lazy (8030.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...

Hash#filter -> Enumerator (8027.0)

key, value のペアについてブロックを評価し,真となるペアだけを含む ハッシュを生成して返します。

...った場合は、自身と select から生成した
Enumerator オブジェクトを返します。

//emlist[][ruby]{
h = { "a" => 100, "b" => 200, "c" => 300 }
h.select {|k,v| k > "a"} #=> {"b" => 200, "c" => 300}
h.select {|k,v| v < 200} #=> {"a" => 100}
//}


@see Hash#select!, Hash#reject...

Hash#filter {|key, value| ... } -> Hash (8027.0)

key, value のペアについてブロックを評価し,真となるペアだけを含む ハッシュを生成して返します。

...った場合は、自身と select から生成した
Enumerator オブジェクトを返します。

//emlist[][ruby]{
h = { "a" => 100, "b" => 200, "c" => 300 }
h.select {|k,v| k > "a"} #=> {"b" => 200, "c" => 300}
h.select {|k,v| v < 200} #=> {"a" => 100}
//}


@see Hash#select!, Hash#reject...

Enumerator::Lazy#eager -> Enumerator (8025.0)

自身を遅延評価しない Enumerator に変換して返します。

...ch.lazy

# select が遅延評価されるので終了する
p lazy_enum.class # => Enumerator::Lazy
p lazy_enum.select { |n| n.even? }.first(5)
# => [2, 4, 6, 8, 10]

# select が遅延評価されないので終了しない
enum = lazy_enum.eager
p enum.class # => Enumerator
p enum.select { |n| n....

絞り込み条件を変える

Array#reject -> Enumerator (8023.0)

各要素に対してブロックを評価し、 その値が偽であった要素を集めた新しい配列を返します。 条件を反転させた select です。

...を返します。
条件を反転させた select です。

ブロックを省略した場合は Enumerator を返します。

//emlist[例][ruby]{
# 偶数を除外する (奇数を集める)
[1, 2, 3, 4, 5, 6].reject {|i| i % 2 == 0 } # => [1, 3, 5]
//}

@see Array#select, Enumerable#reject...
...す。
条件を反転させた select です。

ブロックを省略した場合は Enumerator を返します。

//emlist[例][ruby]{
# 偶数を除外する (奇数を集める)
[1, 2, 3, 4, 5, 6].reject {|i| i % 2 == 0 } # => [1, 3, 5]
//}

@see Array#select, Enumerable#reject
@see Enumerabl...

Array#reject {|item| ... } -> [object] (8023.0)

各要素に対してブロックを評価し、 その値が偽であった要素を集めた新しい配列を返します。 条件を反転させた select です。

...を返します。
条件を反転させた select です。

ブロックを省略した場合は Enumerator を返します。

//emlist[例][ruby]{
# 偶数を除外する (奇数を集める)
[1, 2, 3, 4, 5, 6].reject {|i| i % 2 == 0 } # => [1, 3, 5]
//}

@see Array#select, Enumerable#reject...
...す。
条件を反転させた select です。

ブロックを省略した場合は Enumerator を返します。

//emlist[例][ruby]{
# 偶数を除外する (奇数を集める)
[1, 2, 3, 4, 5, 6].reject {|i| i % 2 == 0 } # => [1, 3, 5]
//}

@see Array#select, Enumerable#reject
@see Enumerabl...

Enumerable#reject -> Enumerator (8023.0)

各要素に対してブロックを評価し、 その値が偽であった要素を集めた新しい配列を返します。 条件を反転させた select です。

...します。
条件を反転させた select です。

ブロックを省略した場合は Enumerator を返します。

//emlist[例][ruby]{
# 偶数を除外する (奇数を集める)
(1..6).reject {|i| i % 2 == 0 } # => [1, 3, 5]
//}

@see Enumerable#select, Array#reject
@see Enumerable#grep_...

Enumerable#reject {|item| ... } -> [object] (8023.0)

各要素に対してブロックを評価し、 その値が偽であった要素を集めた新しい配列を返します。 条件を反転させた select です。

...します。
条件を反転させた select です。

ブロックを省略した場合は Enumerator を返します。

//emlist[例][ruby]{
# 偶数を除外する (奇数を集める)
(1..6).reject {|i| i % 2 == 0 } # => [1, 3, 5]
//}

@see Enumerable#select, Array#reject
@see Enumerable#grep_...

Enumerable#filter -> Enumerator (8021.0)

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

...# => #<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 {|item| ... } -> [object] (8021.0)

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

...# => #<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 -> Enumerator (8021.0)

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

...# => #<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 3 4 5 ... > >>