るりまサーチ

最速Rubyリファレンスマニュアル検索!
236件ヒット [1-100件を表示] (0.048秒)

別のキーワード

  1. _builtin times
  2. integer times
  3. process times
  4. times
  5. times _builtin

クラス

キーワード

検索結果

<< 1 2 3 > >>

Integer#times -> Enumerator (18129.0)

self 回だけ繰り返します。 self が正の整数でない場合は何もしません。

...渡されます。

//emlist[][ruby]{
3.times { puts "Hello, World!" } # Hello, World! と3行続いて表示される。
0.times { puts "Hello, World!" } # 何も表示されない。
5.times {|n| print n } # 01234 と表示される。
//}

@
see Integer#upto, Integer#downto, Numeric#s...

Integer#times {|n| ... } -> self (18129.0)

self 回だけ繰り返します。 self が正の整数でない場合は何もしません。

...渡されます。

//emlist[][ruby]{
3.times { puts "Hello, World!" } # Hello, World! と3行続いて表示される。
0.times { puts "Hello, World!" } # 何も表示されない。
5.times {|n| print n } # 01234 と表示される。
//}

@
see Integer#upto, Integer#downto, Numeric#s...

String#*(times) -> String (150.0)

文字列の内容を times 回だけ繰り返した新しい文字列を作成して返します。

...文字列の内容を times 回だけ繰り返した新しい文字列を作成して返します。

@
param times 整数
@
return self を times 回繰り返した新しい文字列

@
raise ArgumentError 引数に負数を指定したときに発生します。

//emlist[例][ruby]{
p "s...

Array#*(times) -> Array (146.0)

配列の内容を times 回 繰り返した新しい配列を作成して返します。 値はコピーされないことに注意してください。

...配列の内容を times 回 繰り返した新しい配列を作成して返します。
値はコピーされないことに注意してください。

@
param times 繰り返したい回数を整数で指定します。
整数以外のオブジェクトを指定した場合は to_in...
...メソッドによ
る暗黙の型変換を試みます。

@
raise TypeError 引数に整数以外の(暗黙の型変換が行えない)オブジェクトを
指定した場合に発生します。

@
raise ArgumentError 引数に負の数を指定した場合に発生...

Integer#downto(min) -> Enumerator (27.0)

self から min まで 1 ずつ減らしながらブロックを繰り返し実行します。 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 (27.0)

self から min まで 1 ずつ減らしながらブロックを繰り返し実行します。 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#upto(max) -> Enumerator (27.0)

self から max まで 1 ずつ増やしながら繰り返します。 self > max であれば何もしません。

...self から max まで 1 ずつ増やしながら繰り返します。
self > max であれば何もしません。

@
param max 数値
@
return self を返します。

//emlist[][ruby]{
5.upto(10) {|i| print i, " " } # => 5 6 7 8 9 10
//}

@
see Integer#downto, Numeric#step, Integer#times...

Integer#upto(max) {|n| ... } -> Integer (27.0)

self から max まで 1 ずつ増やしながら繰り返します。 self > max であれば何もしません。

...self から max まで 1 ずつ増やしながら繰り返します。
self > max であれば何もしません。

@
param max 数値
@
return self を返します。

//emlist[][ruby]{
5.upto(10) {|i| print i, " " } # => 5 6 7 8 9 10
//}

@
see Integer#downto, Numeric#step, Integer#times...

Object#enum_for(method = :each, *args) -> Enumerator (27.0)

Enumerator.new(self, method, *args) を返します。

...numerator#size がブロックの評価結果を返
します。ブロックパラメータは引数 args です。


@
param method メソッド名の文字列かシンボルです。
@
param args 呼び出すメソッドに渡される引数です。

//emlist[][ruby]{
str = "xyz"

enum = str.enum_f...
...end
each do |*val|
n.times { yield *val }
end
end
end

%i[hello world].repeat(2) { |w| puts w }
# => 'hello', 'hello', 'world', 'world'
enum = (1..14).repeat(3)
# => #<Enumerator: 1..14:repeat(3)>
enum.first(4) # => [1, 1, 1, 2]
enum.size # => 42
//}

@
see Enumerator, Enumerator#size...

Object#enum_for(method = :each, *args) {|*args| ... } -> Enumerator (27.0)

Enumerator.new(self, method, *args) を返します。

...numerator#size がブロックの評価結果を返
します。ブロックパラメータは引数 args です。


@
param method メソッド名の文字列かシンボルです。
@
param args 呼び出すメソッドに渡される引数です。

//emlist[][ruby]{
str = "xyz"

enum = str.enum_f...
...end
each do |*val|
n.times { yield *val }
end
end
end

%i[hello world].repeat(2) { |w| puts w }
# => 'hello', 'hello', 'world', 'world'
enum = (1..14).repeat(3)
# => #<Enumerator: 1..14:repeat(3)>
enum.first(4) # => [1, 1, 1, 2]
enum.size # => 42
//}

@
see Enumerator, Enumerator#size...

絞り込み条件を変える

<< 1 2 3 > >>