クラス
- Date (3)
-
Enumerator
:: Lazy (6) - Integer (2)
検索結果
先頭5件
-
Date
# step(limit , step = 1) -> Enumerator (63982.0) -
ブロックの評価を繰り返します。ブロックは日付オブジェクトをとります。 limit は日付オブジェクトでなければなりません、 また step は非零でなければなりません。
ブロックの評価を繰り返します。ブロックは日付オブジェクトをとります。
limit は日付オブジェクトでなければなりません、
また step は非零でなければなりません。
@param limit 日付オブジェクト
@param step 歩幅
@see Date#downto, Date#upto -
Enumerator
:: Lazy # drop(n) -> Enumerator :: Lazy (36658.0) -
Enumerable#drop と同じですが、配列ではなくEnumerator::Lazy を返します。
Enumerable#drop と同じですが、配列ではなくEnumerator::Lazy を返します。
@param n 要素数を指定します。
@raise ArgumentError n に負の数を指定した場合に発生します。
//emlist[例][ruby]{
1.step.lazy.drop(3)
# => #<Enumerator::Lazy: #<Enumerator::Lazy: #<Enumerator: 1:step>>:drop(3)>
1.step.lazy.drop(3).take(10).force
# => [4, 5, 6, 7, 8, 9, 10, 1... -
Enumerator
:: Lazy # drop _ while {|item| . . . } -> Enumerator :: Lazy (36658.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, 43, 44, 45, 46, 47, 48, 49, 50, 51]
//... -
Enumerator
:: Lazy # find _ all {|item| . . . } -> Enumerator :: Lazy (27658.0) -
Enumerable#select と同じですが、配列ではなくEnumerator::Lazy を返します。
Enumerable#select と同じですが、配列ではなくEnumerator::Lazy を返します。
@raise ArgumentError ブロックを指定しなかった場合に発生します。
//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,... -
Integer
# downto(min) -> Enumerator (27622.0) -
self から min まで 1 ずつ減らしながらブロックを繰り返し実行します。 self < min であれば何もしません。
self から min まで 1 ずつ減らしながらブロックを繰り返し実行します。
self < min であれば何もしません。
@param min 数値
@return self を返します。
//emlist[][ruby]{
5.downto(1) {|i| print i, " " } # => 5 4 3 2 1
//}
@see Integer#upto, Numeric#step, Integer#times -
Integer
# downto(min) {|n| . . . } -> self (27322.0) -
self から min まで 1 ずつ減らしながらブロックを繰り返し実行します。 self < min であれば何もしません。
self から min まで 1 ずつ減らしながらブロックを繰り返し実行します。
self < min であれば何もしません。
@param min 数値
@return self を返します。
//emlist[][ruby]{
5.downto(1) {|i| print i, " " } # => 5 4 3 2 1
//}
@see Integer#upto, Numeric#step, Integer#times -
Date
# downto(min) -> Enumerator (18670.0) -
このメソッドは、step(min, -1){|date| ...} と等価です。
このメソッドは、step(min, -1){|date| ...} と等価です。
@param min 日付オブジェクト
@see Date#step, Date#upto -
Enumerator
:: Lazy # select {|item| . . . } -> Enumerator :: Lazy (18358.0) -
Enumerable#select と同じですが、配列ではなくEnumerator::Lazy を返します。
Enumerable#select と同じですが、配列ではなくEnumerator::Lazy を返します。
@raise ArgumentError ブロックを指定しなかった場合に発生します。
//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,... -
Enumerator
:: Lazy # zip(*lists) -> Enumerator :: Lazy (9376.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)... -
Date
# upto(max) -> Enumerator (9370.0) -
このメソッドは、step(max, 1){|date| ...} と等価です。
このメソッドは、step(max, 1){|date| ...} と等価です。
@param max 日付オブジェクト
@see Date#step, Date#downto -
Enumerator
:: Lazy # zip(*lists) {|v1 , v2 , . . . | . . . } -> nil (9076.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)...