288件ヒット
[1-100件を表示]
(0.031秒)
別のキーワード
種類
- インスタンスメソッド (180)
- モジュール関数 (108)
モジュール
- Benchmark (24)
- Enumerable (48)
- FileUtils (12)
- Math (36)
- Syslog (24)
-
Syslog
:: Macros (12)
検索結果
先頭5件
-
String
# upto(max , exclusive = false) {|s| . . . } -> self (18119.0) -
self から始めて max まで 「次の文字列」を順番にブロックに与えて繰り返します。 「次」の定義については String#succ を参照してください。
...は a, b, c, ... z, aa, ... az, ..., za を
出力します。
//emlist[][ruby]{
("a" .. "za").each do |str|
puts str
end
'a'.upto('za') do |str|
puts str
end
//}
@param max 繰り返しをやめる文字列
@param exclusive max を含むかどうか。false の場合は max を含む。... -
Integer
# upto(max) -> Enumerator (18114.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 (18114.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... -
Date
# upto(max) -> Enumerator (18108.0) -
このメソッドは、step(max, 1){|date| ...} と等価です。
...このメソッドは、step(max, 1){|date| ...} と等価です。
@param max 日付オブジェクト
@see Date#step, Date#downto... -
Date
# upto(max) {|date| . . . } -> self (18108.0) -
このメソッドは、step(max, 1){|date| ...} と等価です。
...このメソッドは、step(max, 1){|date| ...} と等価です。
@param max 日付オブジェクト
@see Date#step, Date#downto... -
FileUtils
. # uptodate?(newer , older _ list , options = nil) -> bool (6118.0) -
newer が、older_list に含まれるすべてのファイルより新しいとき真。 存在しないファイルは無限に古いとみなされます。
...いとき真。
存在しないファイルは無限に古いとみなされます。
@param newer ファイルを一つ指定します。
@param older_list ファイル名の配列を指定します。
@param options どのようなオプションも指定することはできません。
@rais......e ArgumentError options にオプションを指定した場合に発生します。
//emlist[][ruby]{
require 'fileutils'
FileUtils.uptodate?('hello.o', ['hello.c', 'hello.h']) or system('make')
//}... -
Syslog
:: Macros . # LOG _ UPTO(priority) -> Integer (6113.0) -
priorityまでのすべての優先度のマスクを作成します。
...のすべての優先度のマスクを作成します。
@param priority priority は優先度を示す定数を指定します。
詳しくは、Syslog::Levelを参照してください。
例:
require 'syslog'
Syslog.mask = Syslog::LOG_UPTO(Syslog::LOG_ERR)... -
Benchmark
. # bm(label _ width = 0 , *labels) {|rep| . . . } -> [Benchmark :: Tms] (54.0) -
Benchmark.#benchmark メソッドの引数を簡略化したものです。
...メソッドの引数を簡略化したものです。
Benchmark.#benchmark メソッドと同様に働きます。
@param label_width ラベルの幅を指定します。
@param labels ブロックが Benchmark::Tms オブジェクトの配列を返す場合に指定します。
//emlist[][......ire 'benchmark'
n = 50000
Benchmark.bm do |x|
x.report { for i in 1..n; a = "1"; end }
x.report { n.times do ; a = "1"; end }
x.report { 1.upto(n) do ; a = "1"; end }
end
#=>
#
# user system total real
# 1.033333 0.016667 1.016667 ( 0.492106)
# 1.483333 0.000000......times do ; a = "1"; end }
x.report("upto:") { 1.upto(n) do ; a = "1"; end }
end
#=>
# user system total real
# for: 1.050000 0.000000 1.050000 ( 0.503462)
# times: 1.533333 0.016667 1.550000 ( 0.735473)
# upto: 1.500000 0.016667 1.516667 ( 0... -
Benchmark
. # benchmark(caption = "" , label _ width = nil , fmtstr = nil , *labels) {|rep| . . . } -> [Benchmark :: Tms] (42.0) -
Benchmark::Report オブジェクトを生成し、それを引数として与えられたブロックを実行します。
...場合は、
それらの数値も追加の行に表示されます。
@param caption レポートの一行目に表示する文字列を指定します。
@param label_width ラベルの幅を指定します。
@param fmtstr フォーマット文字列を指定します。......この引数を省略すると Benchmark::FORMAT が使用されます。
@param labels ブロックが Benchmark::Tms オブジェクトの配列を返す場合に指定します。
=== フォーマット文字列
フォーマット文字列として以下が使用できます。
: %u
use......; end }
tu = x.report("upto:") { 1.upto(n) do ; a = "1"; end }
[tf+tt+tu, (tf+tt+tu)/3]
end
#=>
#
# user system total real
# for: 1.016667 0.016667 1.033333 ( 0.485749)
# times: 1.450000 0.016667 1.466667 ( 0.681367)
# upto: 1.533333 0.000000...