種類
- インスタンスメソッド (102)
- 文書 (26)
- ライブラリ (22)
- クラス (6)
ライブラリ
- ビルトイン (108)
クラス
-
Enumerator
:: ArithmeticSequence (18) -
Enumerator
:: Lazy (54) - Numeric (18)
- Range (12)
キーワード
- % (6)
- == (6)
- ArithmeticSequence (6)
-
NEWS for Ruby 2
. 1 . 0 (11) -
NEWS for Ruby 3
. 0 . 0 (4) - chunk (11)
- debug (11)
-
drop
_ while (11) - hash (6)
- rake (11)
-
ruby 1
. 6 feature (11) -
slice
_ when (10) -
take
_ while (22)
検索結果
先頭5件
- Enumerator
:: ArithmeticSequence # step -> Numeric - Numeric
# step(by: 1 , to: Float :: INFINITY) -> Enumerator :: ArithmeticSequence - Numeric
# step(by: , to: -Float :: INFINITY) -> Enumerator :: ArithmeticSequence - Numeric
# step(limit , step = 1) -> Enumerator :: ArithmeticSequence - Range
# step(s = 1) -> Enumerator :: ArithmeticSequence
-
Enumerator
:: ArithmeticSequence # step -> Numeric (24201.0) -
公差 (各ステップの大きさ) を返します。
公差 (各ステップの大きさ) を返します。 -
Numeric
# step(by: 1 , to: Float :: INFINITY) -> Enumerator :: ArithmeticSequence (21544.0) -
self からはじめ step を足しながら limit を越える 前までブロックを繰り返します。step は負の数も指定できます。また、limit や step には Float なども 指定できます。
...はじめ step を足しながら limit を越える
前までブロックを繰り返します。step は負の数も指定できます。また、limit や step には Float なども
指定できます。
@param limit ループの上限あるいは下限を数値で指定します。step に負......m step 各ステップの大きさを数値で指定します。負の数を指定することもできます。
@param to 引数limitと同じですが、省略した場合はキーワード引数byが正の
数であれば Float::INFINITY、負の数であれば
-Float::INFINI...... step と同じです。
@return ブロックが指定された時は self を返します。
@return ブロックが指定されなかった時は Enumerator を返します。
@return 特に limit (または to) と step の両方が Numeric または nil の時は
Enumerator::ArithmeticS... -
Numeric
# step(by: , to: -Float :: INFINITY) -> Enumerator :: ArithmeticSequence (21544.0) -
self からはじめ step を足しながら limit を越える 前までブロックを繰り返します。step は負の数も指定できます。また、limit や step には Float なども 指定できます。
...はじめ step を足しながら limit を越える
前までブロックを繰り返します。step は負の数も指定できます。また、limit や step には Float なども
指定できます。
@param limit ループの上限あるいは下限を数値で指定します。step に負......m step 各ステップの大きさを数値で指定します。負の数を指定することもできます。
@param to 引数limitと同じですが、省略した場合はキーワード引数byが正の
数であれば Float::INFINITY、負の数であれば
-Float::INFINI...... step と同じです。
@return ブロックが指定された時は self を返します。
@return ブロックが指定されなかった時は Enumerator を返します。
@return 特に limit (または to) と step の両方が Numeric または nil の時は
Enumerator::ArithmeticS... -
Numeric
# step(limit , step = 1) -> Enumerator :: ArithmeticSequence (21544.0) -
self からはじめ step を足しながら limit を越える 前までブロックを繰り返します。step は負の数も指定できます。また、limit や step には Float なども 指定できます。
...はじめ step を足しながら limit を越える
前までブロックを繰り返します。step は負の数も指定できます。また、limit や step には Float なども
指定できます。
@param limit ループの上限あるいは下限を数値で指定します。step に負......m step 各ステップの大きさを数値で指定します。負の数を指定することもできます。
@param to 引数limitと同じですが、省略した場合はキーワード引数byが正の
数であれば Float::INFINITY、負の数であれば
-Float::INFINI...... step と同じです。
@return ブロックが指定された時は self を返します。
@return ブロックが指定されなかった時は Enumerator を返します。
@return 特に limit (または to) と step の両方が Numeric または nil の時は
Enumerator::ArithmeticS... -
Range
# step(s = 1) -> Enumerator :: ArithmeticSequence (15309.0) -
範囲内の要素を s おきに繰り返します。
...た時かつ数値の Range の時は Enumerator::ArithmeticSequence を返します。
@return ブロックを指定しなかったその他の Range の時は Enumerator を返します。(例: String の Range)
//emlist[例][ruby]{
("a" .. "f").step(2) {|v| p v}
# => "a"
# "c"
# "e"
//}... -
Enumerator
:: Lazy # drop _ while {|item| . . . } -> Enumerator :: Lazy (12242.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]
//}
@see Enumerable#drop_while... -
Enumerator
:: Lazy # slice _ when {|elt _ before , elt _ after| bool } -> Enumerator :: Lazy (12236.0) -
Enumerable#slice_when と同じですが、配列ではなく Enumerator::Lazy を返します。
...erable#slice_when と同じですが、配列ではなく Enumerator::Lazy を返します。
//emlist[例][ruby]{
1.step.lazy.slice_when { |i, j| (i + j) % 5 == 0 }
# => #<Enumerator::Lazy: #<Enumerator: #<Enumerator::Generator:0x00007fce84118348>:each>>
1.step.lazy.slice_when { |i, j| (i + j) %......5 == 0 }.take(5).force
# => [[1, 2], [3, 4, 5, 6, 7], [8, 9, 10, 11, 12], [13, 14, 15, 16, 17], [18, 19, 20, 21, 22]]
//}
@see Enumerable#slice_when... -
Enumerator
:: Lazy # take _ while -> Enumerator :: Lazy (12218.0) -
Enumerable#take_while と同じですが、配列ではなくEnumerator::Lazy を返します。
...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| e.first < 100_000 }.force.last(5)
# => [[99995, "y"], [99996, "z"], [99997, "a"], [99998, "b"], [99999, "c"]]
//}
@see Enumerable#take_while... -
Enumerator
:: Lazy # take _ while {|item| . . . } -> Enumerator :: Lazy (12218.0) -
Enumerable#take_while と同じですが、配列ではなくEnumerator::Lazy を返します。
...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| e.first < 100_000 }.force.last(5)
# => [[99995, "y"], [99996, "z"], [99997, "a"], [99998, "b"], [99999, "c"]]
//}
@see Enumerable#take_while... -
Enumerator
:: ArithmeticSequence (12012.0) -
等差数列を提供するためのクラス。
...等差数列を提供するためのクラス。
ArithmeticSequenceオブジェクトは、Numeric#step, Range#step によって生成されます。... -
Enumerator
:: ArithmeticSequence # hash -> Integer (9206.0) -
自身のハッシュ値を返します。
...自身のハッシュ値を返します。
begin, end, step, exclude_end? が等しい Enumerable::ArithmeticSequence は
同じハッシュ値を返します。... -
Enumerator
:: Lazy # chunk(initial _ state) {|elt , state| . . . } -> Enumerator :: Lazy (6212.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... -
Enumerator
:: ArithmeticSequence # ==(other) -> bool (6106.0) -
Enumerable::ArithmeticSequence として等しいか判定します。
...Enumerable::ArithmeticSequence として等しいか判定します。
other が Enumerable::ArithmeticSequence で
begin, end, step, exclude_end? が等しい時に
true を返します。
@param other 自身と比較する Enumerable::ArithmeticSequence...