るりまサーチ

最速Rubyリファレンスマニュアル検索!
2770件ヒット [1401-1500件を表示] (0.153秒)
トップページ > クエリ:Enumerable[x]

別のキーワード

  1. enumerable max
  2. enumerable min
  3. enumerable max_by
  4. enumerable min_by
  5. enumerable count

ライブラリ

クラス

モジュール

オブジェクト

キーワード

検索結果

<< < ... 13 14 15 16 17 ... > >>

NEWS for Ruby 2.3.0 (36.0)

NEWS for Ruby 2.3.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。

...rescue しません
7688

* Encoding
* Encoding::IBM037 (alias ebcdic-cp-us; dummy) を追加

* Enumerable
* Enumerable#grep_v を追加
11049
* Enumerable#chunk_while
10769

* Enumerator::Lazy
* Enumerator::Lazy#grep_v を追加
11773

* File
*...
...
互換性のないエンコーディングであっても例外が発生しなくなりました。
11801

* Enumerable
* Enumerable#chunk と Enumerable#slice_before は初期状態を引数として受け取らなくなりました。
状態の管理にはローカル...

Enumerator.produce(initial = nil) { |prev| ... } -> Enumerator (30.0)

与えられたブロックを呼び出し続ける、停止しない Enumerator を返します。 ブロックの戻り値が、次にブロックを呼び出す時に引数として渡されます。 initial 引数が渡された場合、最初にブロックを呼び出す時にそれがブロック 呼び出しの引数として渡されます。initial が渡されなかった場合は nil が 渡されます。

...ッドは Enumerable の各メソッドと組み合わせて使うことで、
while や until ループのような処理を実装できます。
例えば Enumerable#detect, Enumerable#slice_after, Enumerable#take_while
などと合わせて使えるでしょう。

//emlist[Enumerable のメソ...

NEWS for Ruby 2.5.0 (30.0)

NEWS for Ruby 2.5.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。

...するようになりました
* Dir.children を追加 11302
* Dir.each_child を追加 11302

* Enumerable
* Enumerable#any?, Enumerable#all?, Enumerable#none?, Enumerable#one?
がブロックを省略して1つの引数を受け取ることができるようになりました...

Enumerator (28.0)

each 以外のメソッドにも Enumerable の機能を提供するためのラッパークラスです。 また、外部イテレータとしても使えます。

...each 以外のメソッドにも Enumerable の機能を提供するためのラッパークラスです。
また、外部イテレータとしても使えます。

Enumerable
モジュールは、 Module#include 先のクラスが持つ
each メソッドを元に様々なメソッドを提供し...
...ます。
Enumerator を介することにより String#each_byte のような
異なる名前のイテレータについても each と同様に Enumerable の機能を利用できます。

Enumerator を生成するには Enumerator.newあるいは
Object#to_enum, Object#enum_for を利用しま...

Enumerator::ArithmeticSequence#==(other) -> bool (28.0)

Enumerable::ArithmeticSequence として等しいか判定します。

...
Enumerable
::ArithmeticSequence として等しいか判定します。

other が Enumerable::ArithmeticSequence で
begin, end, step, exclude_end? が等しい時に
true を返します。

@param other 自身と比較する Enumerable::ArithmeticSequence...

絞り込み条件を変える

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

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

...
Enumerable
#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::INFINIT...
...Y).lazy.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#grep_v(pattern) {|item| ... } -> Enumerator::Lazy (28.0)

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

...
Enumerable
#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::INFINIT...
...Y).lazy.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#take(n) -> Enumerator::Lazy (28.0)

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

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

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

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

@raise Arg...
...umentError 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#zip(*lists) -> Enumerator::Lazy (28.0)

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

...
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"], [27, "a"], [28, "b"], [29, "c"], [30, "d"]]
//}

@see Enumerable#zip...

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

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

...
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"], [27, "a"], [28, "b"], [29, "c"], [30, "d"]]
//}

@see Enumerable#zip...

絞り込み条件を変える

ruby 1.9 feature (24.0)

ruby 1.9 feature ruby version 1.9.0 は開発版です。 以下にあげる機能は将来削除されたり互換性のない仕様変更がなされるかもしれません。 1.9.1 以降は安定版です。 バグ修正がメインになります。

...teger#upto [compat]
: Integer#downto [compat]
: Integer#doitems [compat]

ブロックがなければ enumerator を返す

: Enumerable#group_by [new]
: Enumerable#first [new]

追加

=== 2006-01-26

: ((<BasicSocket/BasicSocket.do_not_reverse_lookup>)) [compat]

do_not_reverse_lo...
...5]

=== 2004-07-16

: File::Stat#dev_major [new]
: File::Stat#dev_minor [new]

追加。((<ruby-core:03195>))

=== 2004-07-14

: Enumerable#max_by [new]
: Enumerable#min_by [new]

ブロックの結果を大小比較し、その最大値、最小値を示す要素を返します。...

Enumerator::Lazy#chunk {|elt| ... } -> Enumerator::Lazy (22.0)

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

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

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

1.step.lazy.chunk{ |n| n % 3 == 0 }.take(5).force
# => [[fa...
...lse, [1, 2]], [true, [3]], [false, [4, 5]], [true, [6]], [false, [7, 8]]]
//}

@see Enumerable#chunk...
<< < ... 13 14 15 16 17 ... > >>