るりまサーチ

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

別のキーワード

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

ライブラリ

キーワード

検索結果

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

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

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

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

//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]
//}...

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

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

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

//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, 9, 10, 11]
//}

@see Enu...

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

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

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

//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, 9, 11, 13, 15, 17, 19]
//}

@s...

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

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

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

//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]
//}...

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

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

...数を指定します。

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

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

1.step.lazy.take(5).force
# => [1, 2, 3, 4, 5]
//}

@see Enumerable#take...

絞り込み条件を変える

Enumerator::Lazy#take_while -> Enumerator::Lazy (8018.0)

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

...を返します。

//emlist[例][ruby]{
1.step.lazy.zip(('a'..'z').cycle).take_while { |e| e.first < 100_000 }
# => #<Enumerator::Lazy: #<Enumerator::Lazy: #<Enumerator::Lazy: #<Enumerator: 1:step>>:zip(#<Enumerator: "a".."z":cycle>)>:take_while>

1.step.lazy.zip(('a'..'z').cycle).take_while { |e|...

Enumerator::Lazy#take_while {|item| ... } -> Enumerator::Lazy (8018.0)

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

...を返します。

//emlist[例][ruby]{
1.step.lazy.zip(('a'..'z').cycle).take_while { |e| e.first < 100_000 }
# => #<Enumerator::Lazy: #<Enumerator::Lazy: #<Enumerator::Lazy: #<Enumerator: 1:step>>:zip(#<Enumerator: "a".."z":cycle>)>:take_while>

1.step.lazy.zip(('a'..'z').cycle).take_while { |e|...

Enumerator::Lazy#zip(*lists) -> Enumerator::Lazy (8018.0)

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

...は Enumerable#zip と
同じ挙動になります。

//emlist[例][ruby]{
1.step.lazy.zip(('a'..'z').cycle)
# => #<Enumerator::Lazy: #<Enumerator::Lazy: #<Enumerator: 1:step>>:zip(#<Enumerator: "a".."z":cycle>)>

1.step.lazy.zip(('a'..'z').cycle).take(30).force.last(6)
# => [[25, "y"], [26, "z"],...

Enumerator::Lazy#zip(*lists) {|v1, v2, ...| ... } -> nil (8018.0)

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

...は Enumerable#zip と
同じ挙動になります。

//emlist[例][ruby]{
1.step.lazy.zip(('a'..'z').cycle)
# => #<Enumerator::Lazy: #<Enumerator::Lazy: #<Enumerator: 1:step>>:zip(#<Enumerator: "a".."z":cycle>)>

1.step.lazy.zip(('a'..'z').cycle).take(30).force.last(6)
# => [[25, "y"], [26, "z"],...
<< < 1 2 3 4 5 ... > >>