ライブラリ
クラス
-
ARGF
. class (126) - Array (324)
- Complex (24)
- Date (36)
- Dir (19)
- Enumerator (187)
-
Enumerator
:: ArithmeticSequence (98) -
Enumerator
:: Chain (35) -
Enumerator
:: Lazy (417) -
Enumerator
:: Yielder (30) - Float (24)
-
Gem
:: SourceIndex (12) - Hash (168)
- IO (150)
- Integer (60)
- Matrix (86)
- Numeric (81)
- Object (63)
- OpenStruct (12)
- Pathname (63)
- Prime (12)
-
Prime
:: PseudoPrimeGenerator (36) -
Psych
:: Nodes :: Node (12) -
REXML
:: Parent (48) - Range (59)
- Rational (24)
- String (80)
- StringIO (88)
- Struct (43)
- Vector (74)
-
Zlib
:: GzipReader (36)
モジュール
- Enumerable (440)
- TSort (33)
キーワード
- % (14)
- + (7)
- << (12)
- == (7)
- ascend (12)
- begin (7)
- bsearch (24)
-
bsearch
_ index (10) - bytes (21)
- chain (7)
- chars (21)
- chunk (36)
-
chunk
_ while (21) - codepoints (21)
- collect (60)
- collect! (26)
- collect2 (12)
-
collect
_ concat (24) - combination (12)
- compact (4)
- cycle (24)
-
delete
_ if (36) - denominator (60)
- descend (12)
- detect (12)
- downto (24)
- drop (12)
-
drop
_ while (36) - each (292)
- each2 (12)
-
each
_ byte (60) -
each
_ char (48) -
each
_ child (31) -
each
_ codepoint (48) -
each
_ cons (12) -
each
_ entry (15) -
each
_ grapheme _ cluster (8) -
each
_ index (24) -
each
_ key (12) -
each
_ line (108) -
each
_ pair (36) -
each
_ slice (12) -
each
_ strongly _ connected _ component (11) -
each
_ strongly _ connected _ component _ from (11) -
each
_ value (12) -
each
_ with _ index (36) -
each
_ with _ object (12) - eager (6)
- end (7)
-
enum
_ for (48) -
exclude
_ end? (7) - feed (12)
- filter (35)
- filter! (14)
-
filter
_ map (12) - find (24)
-
find
_ all (24) -
find
_ index (36) - first (14)
-
flat
_ map (24) - force (12)
- grep (12)
-
grep
_ v (10) -
group
_ by (12) - gsub (12)
- gsub! (12)
- hash (7)
- index (24)
- inspect (14)
-
keep
_ if (24) - last (14)
- lazy (24)
- lines (49)
- map (60)
- map! (26)
-
max
_ by (24) -
min
_ by (24) -
minmax
_ by (12) - next (12)
-
next
_ values (12) - partition (12)
- peek (12)
-
peek
_ values (12) - permutation (12)
- reject (48)
- reject! (24)
-
repeated
_ combination (12) -
repeated
_ permutation (12) -
reverse
_ each (26) - rewind (19)
- rindex (12)
- select (60)
- select! (24)
- size (26)
-
slice
_ after (46) -
slice
_ before (60) -
slice
_ when (23) -
sort
_ by (12) -
sort
_ by! (12) - step (95)
- take (12)
-
take
_ while (48) - then (7)
- times (12)
-
to
_ enum (48) -
to
_ proc (6) -
transform
_ keys (8) -
transform
_ keys! (8) -
transform
_ values (9) -
transform
_ values! (9) -
tsort
_ each (11) - uniq (18)
- upto (24)
-
with
_ index (48) -
with
_ object (36) - yield (12)
-
yield
_ self (8) - zip (24)
検索結果
先頭5件
-
Enumerator
# with _ object(obj) -> Enumerator (3101.0) -
繰り返しの各要素に obj を添えてブロックを繰り返し、obj を返り値として返します。
...かった場合は、上で説明した繰り返しを実行し、
最後に obj を返す Enumerator を返します。
//emlist[例][ruby]{
# 0,1,2 と呼びだす enumeratorを作る
to_three = Enumerator.new do |y|
3.times do |x|
y << x
end
end
to_three_with_string = to_three.with_obje... -
Enumerator
:: Chain # each(*args) -> Enumerator (3101.0) -
まず最初の繰り返し可能なオブジェクトの each メソッドを args 引数とともに呼び出した後、続く繰り返し可能なオブジェクト も同様に呼び出します。
...まず最初の繰り返し可能なオブジェクトの each メソッドを
args 引数とともに呼び出した後、続く繰り返し可能なオブジェクト
も同様に呼び出します。
ブロックが渡されない場合は Enumerator を返します。... -
Enumerator
:: Lazy # chunk {|elt| . . . } -> Enumerator :: Lazy (3101.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... -
Enumerator
:: Lazy # chunk(initial _ state) {|elt , state| . . . } -> Enumerator :: Lazy (3101.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... -
Enumerator
:: Lazy # chunk _ while {|elt _ before , elt _ after| . . . } -> Enumerator :: Lazy (3101.0) -
Enumerable#chunk_while と同じですが、Enumerator ではなく Enumerator::Lazy を返します。
...Enumerable#chunk_while と同じですが、Enumerator ではなく Enumerator::Lazy を返します。
@raise ArgumentError ブロックを指定しなかった場合に発生します。... -
Enumerator
:: Lazy # collect {|item| . . . } -> Enumerator :: Lazy (3101.0) -
Enumerable#map と同じですが、配列ではなくEnumerator::Lazy を返します。
...ですが、配列ではなくEnumerator::Lazy を返します。
@raise ArgumentError ブロックを指定しなかった場合に発生します。
//emlist[例][ruby]{
1.step.lazy.map{ |n| n % 3 == 0 }
# => #<Enumerator::Lazy: #<Enumerator::Lazy: #<Enumerator: 1:step>>:map>
1.step.lazy.collec... -
Enumerator
:: Lazy # collect _ concat {|item| . . . } -> Enumerator :: Lazy (3101.0) -
ブロックの実行結果をひとつに繋げたものに対してイテレートするような Enumerator::Lazy のインスタンスを返します。
...ブロックの実行結果をひとつに繋げたものに対してイテレートするような
Enumerator::Lazy のインスタンスを返します。
//emlist[][ruby]{
["foo", "bar"].lazy.flat_map {|i| i.each_char.lazy}.force
#=> ["f", "o", "o", "b", "a", "r"]
//}
ブロックの返した......結されます。
* x が配列であるか、to_ary メソッドを持つとき
* x が each および force メソッドを持つ (例:Enumerator::Lazy) とき
それ以外のときは、x は分解されず、そのままの値として使われます。
//emlist[][ruby]{
[{a:1}, {b:2}].l... -
Enumerator
:: Lazy # compact -> Enumerator :: Lazy (3101.0) -
Enumerable#compact と同じですが、配列ではなく Enumerator::Lazy を返します。
...Enumerable#compact と同じですが、配列ではなく Enumerator::Lazy を返します。... -
Enumerator
:: Lazy # drop(n) -> Enumerator :: Lazy (3101.0) -
Enumerable#drop と同じですが、配列ではなくEnumerator::Lazy を返します。
...、配列ではなくEnumerator::Lazy を返します。
@param n 要素数を指定します。
@raise ArgumentError n に負の数を指定した場合に発生します。
//emlist[例][ruby]{
1.step.lazy.drop(3)
# => #<Enumerator::Lazy: #<Enumerator::Lazy: #<Enumerator: 1:step>>:drop(3)>
1.s... -
Enumerator
:: Lazy # drop _ while {|item| . . . } -> Enumerator :: Lazy (3101.0) -
Enumerable#drop_while と同じですが、配列ではなくEnumerator::Lazy を返します。
...Enumerable#drop_while と同じですが、配列ではなくEnumerator::Lazy を返します。
//emlist[例][ruby]{
1.step.lazy.drop_while { |i| i < 42 }
# => #<Enumerator::Lazy: #<Enumerator::Lazy: #<Enumerator: 1:step>>:drop_while>
1.step.lazy.drop_while { |i| i < 42 }.take(10).force
# => [42... -
Enumerator
:: Lazy # eager -> Enumerator (3101.0) -
自身を遅延評価しない Enumerator に変換して返します。
...自身を遅延評価しない Enumerator に変換して返します。
//emlist[例][ruby]{
lazy_enum = (1..).each.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.even? }.first(5)
//}...