ライブラリ
- ビルトイン (2476)
- matrix (44)
- pp (11)
- readline (11)
-
rexml
/ document (22) -
ripper
/ filter (11) - set (66)
クラス
- Array (436)
- Enumerator (33)
-
Enumerator
:: ArithmeticSequence (12) -
Enumerator
:: Chain (6) -
Enumerator
:: Lazy (363) - Hash (34)
- Matrix (22)
- Module (22)
- Object (55)
- PP (11)
-
REXML
:: Elements (22) - Range (84)
- Refinement (3)
- Regexp (11)
-
Ripper
:: Filter (11) - Set (44)
- Struct (34)
-
Thread
:: Queue (6) - Vector (22)
モジュール
- Enumerable (1316)
キーワード
- + (6)
-
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (11) - == (6)
- === (22)
- Chain (6)
- Enumerator (11)
- HISTORY (11)
- Lazy (11)
-
NEWS for Ruby 2
. 0 . 0 (11) -
NEWS for Ruby 2
. 1 . 0 (11) -
NEWS for Ruby 2
. 2 . 0 (10) -
NEWS for Ruby 2
. 3 . 0 (9) -
NEWS for Ruby 2
. 4 . 0 (8) -
NEWS for Ruby 2
. 5 . 0 (7) -
NEWS for Ruby 2
. 6 . 0 (6) -
NEWS for Ruby 2
. 7 . 0 (5) -
NEWS for Ruby 3
. 0 . 0 (4) -
NEWS for Ruby 3
. 1 . 0 (3) - Range (11)
- Ruby用語集 (11)
- all? (47)
- any? (56)
- build (22)
- chain (6)
- chunk (33)
-
chunk
_ while (19) - collect (66)
- collect! (11)
-
collect
_ concat (33) - compact (6)
- count (66)
- cycle (22)
-
delete
_ if (11) - detect (22)
- drop (33)
-
drop
_ while (55) - each (22)
-
each
_ cons (22) -
each
_ entry (22) -
each
_ slice (22) -
each
_ with _ index (22) -
each
_ with _ object (22) - entries (11)
-
enum
_ for (44) - filter (42)
-
filter
_ map (15) - find (22)
-
find
_ all (33) -
find
_ index (33) - first (22)
-
flat
_ map (33) - force (11)
- grep (33)
-
grep
_ v (31) -
group
_ by (22) - hash (6)
-
import
_ methods (3) - include (22)
- include? (11)
- inject (44)
- lazy (11)
- map (55)
- map! (11)
- max (118)
-
max
_ by (44) - member? (11)
- min (118)
-
min
_ by (44) - minmax (32)
-
minmax
_ by (22) - new (23)
- none? (47)
- one? (47)
- parse (11)
- partition (22)
- prepended (11)
- produce (5)
- reduce (33)
- reject (99)
- reject! (11)
-
reverse
_ each (22) -
ruby 1
. 6 feature (11) -
ruby 1
. 9 feature (11) - select (77)
- seplist (11)
- set (11)
-
slice
_ after (42) -
slice
_ before (55) -
slice
_ when (21) - sort (44)
- sort! (22)
-
sort
_ by (22) -
sort
_ by! (22) - sum (38)
- take (33)
-
take
_ while (66) - tally (8)
-
to
_ a (11) -
to
_ enum (44) -
to
_ h (29) -
to
_ set (22) - uniq (38)
-
with
_ object (22) - zip (44)
検索結果
先頭5件
-
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...