るりまサーチ

最速Rubyリファレンスマニュアル検索!
38件ヒット [1-38件を表示] (0.191秒)
トップページ > クエリ:l[x] > クエリ:r[x] > クエリ:v[x] > クエリ:to[x] > クエリ:grep_v[x]

別のキーワード

  1. socket ipv6_v6only
  2. socket ai_v4mapped
  3. socket ai_v4mapped_cfg
  4. _builtin grep_v
  5. enumerable grep_v

ライブラリ

クラス

モジュール

キーワード

検索結果

Enumerator::Lazy#grep_v(pattern) {|item| ... } -> Enumerator::Lazy (36594.0)

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

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

//emlist[例][ruby]{
(100..Float::INFINITY).lazy.map(&:to_s).grep_v(/(\d).*\1/)
# => #<Enumerator::Lazy: #<Enumerator::Lazy: #<Enumerator::Lazy: 100..Infinity>:map>:grep_v(/(\d).*\1/)>
(100..Float::INFINITY).la...
...zy.map(&:to_s).grep_v(/(\d).*\1/).take(15).force
# => ["102", "103", "104", "105", "106", "107", "108", "109", "120", "123", "124", "125", "126", "127", "128"]
//}

@see Enumerable#grep_v, Enumerable#grep, Enumerator::Lazy#grep...

Enumerator::Lazy#grep(pattern) {|item| ... } -> Enumerator::Lazy (12336.0)

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

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

//emlist[例][ruby]{
(100..Float::INFINITY).lazy.map(&:to_s).grep(/\A(\d)\1+\z/)
# => #<Enumerator::Lazy: #<Enumerator::Lazy: #<Enumerator::Lazy: 100..Infinity>:map>:grep(/\A(\d)\1+\z/)>
(100..Float::INFINITY).la...
...zy.map(&:to_s).grep(/\A(\d)\1+\z/).take(10).force
# => ["111", "222", "333", "444", "555", "666", "777", "888", "999", "1111"]
//}

@see Enumerable#grep, Enumerable#grep_v, Enumerator::Lazy#grep_v...

Enumerator::Lazy (12012.0)

map や select などのメソッドの遅延評価版を提供するためのクラス。

...select などのメソッドの遅延評価版を提供するためのクラス。

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

* map/collect
* flat_...
...map/collect_concat
* select/find_all
* reject
* grep, grep_v
* take, take_while
* drop, drop_while
* slice_before, slice_after, slice_when
* chunk
* zip (※互換性のため、ブロックを渡さないケースのみlazy)

L
azyオブジェクトは、Enumerable#lazyメソッドによっ...
...す。

L
azyから値を取り出すには、Enumerator::Lazy#force または
Enumerable#first を呼びます。

//emlist[例][ruby]{
# 二乗して偶数になるような整数を、小さい方から5個表示する
p 1.step.lazy.select{|n| (n**2).even?}.first(5)
# LTSV (http://ltsv.org/) 形...
...ap/collect_concat
* select/find_all
* reject
* grep, grep_v
* take, take_while
* drop, drop_while
* slice_before, slice_after, slice_when
* chunk, chunk_while
* uniq
* zip (※互換性のため、ブロックを渡さないケースのみlazy)

L
azyオブジェクトは、Enumerable#lazy...
...ollect_concat
* filter_map
* select/find_all
* reject
* grep, grep_v
* take, take_while
* drop, drop_while
* slice_before, slice_after, slice_when
* chunk, chunk_while
* uniq
* zip (※互換性のため、ブロックを渡さないケースのみlazy)

L
azyオブジェクトは、Enumera...
...#lazyメソッドによって生成されます。

L
azyから値を取り出すには、Enumerator::Lazy#force または
Enumerable#first を呼びます。

//emlist[例][ruby]{
# 二乗して偶数になるような整数を、小さい方から5個表示する
p 1.step.lazy.select{|n| (n**2).eve...
...map/collect_concat
* filter_map
* select/find_all
* reject
* grep, grep_v
* take, take_while
* drop, drop_while
* slice_before, slice_after, slice_when
* chunk, chunk_while
* uniq
* compact
* zip (※互換性のため、ブロックを渡さないケースのみlazy)

L
azyオブジェク...

Enumerable#reject -> Enumerator (9212.0)

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

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

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

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

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