286件ヒット
[1-100件を表示]
(0.118秒)
種類
- インスタンスメソッド (193)
- モジュール関数 (44)
- 特異メソッド (27)
- クラス (22)
クラス
- Array (22)
- Binding (10)
- Enumerator (22)
- IO (11)
- Integer (66)
- Object (44)
- String (11)
- Thread (16)
-
Thread
:: ConditionVariable (18)
キーワード
- * (33)
- Fiber (11)
- Numeric (11)
-
at
_ exit (11) - broadcast (9)
-
clock
_ gettime (11) - downto (22)
-
enum
_ for (22) -
local
_ variables (10) -
report
_ on _ exception (8) -
report
_ on _ exception= (8) - select (11)
- signal (9)
-
to
_ enum (22) - upto (22)
- waitall (11)
-
with
_ object (22)
検索結果
先頭5件
-
Integer
# times -> Enumerator (32222.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#step... -
Integer
# times {|n| . . . } -> self (32222.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#step... -
Process
. # times -> Process :: Tms (32203.0) -
自身のプロセスとその子プロセスが消費したユーザ/システム CPU 時間の積算を Process::Tms オブジェクトで返します。 時間の単位は秒で、浮動小数点数で与えられます。
...ム CPU 時間の積算を
Process::Tms オブジェクトで返します。
時間の単位は秒で、浮動小数点数で与えられます。
@raise NotImplementedError メソッドが現在のプラットフォームで実装されていない場合に発生します。
@see Process::Tms... -
Binding
# local _ variables -> [Symbol] (17108.0) -
ローカル変数の一覧を Symbol の配列で返します。
...カル変数の一覧を Symbol の配列で返します。
//emlist[例][ruby]{
def foo
a = 1
2.times do |n|
binding.local_variables #=> [:a, :n]
end
end
//}
このメソッドは以下のコードと同様の動作をします。
//emlist[][ruby]{
binding.eval("local_variables")
//}... -
Process
. # clock _ gettime(clock _ id , unit=:float _ second) -> Float | Integer (14132.0) -
POSIX の clock_gettime() 関数の時間を返します。
...POSIX の clock_gettime() 関数の時間を返します。
例:
p Process.clock_gettime(Process::CLOCK_MONOTONIC) #=> 896053.968060096
@param clock_id クロックの種類を以下の定数のいずれかで指定します。
サポートされている定数は OS やバー......ます。
: Process::CLOCK_REALTIME
SUSv2 to 4, Linux 2.5.63, FreeBSD 3.0, NetBSD 2.0, OpenBSD 2.1, macOS 10.12
: Process::CLOCK_MONOTONIC
SUSv3 to 4, Linux 2.5.63, FreeBSD 3.0, NetBSD 2.0, OpenBSD 3.4, macOS 10.12
: Process::CLOCK_PROCESS_CPUTIME_ID
SUSv3 to 4, Linux 2.5.63, OpenBSD 5.4, macOS......TIME_ID
SUSv3 to 4, Linux 2.5.63, FreeBSD 7.1, OpenBSD 5.4, macOS 10.12
: Process::CLOCK_VIRTUAL
FreeBSD 3.0, OpenBSD 2.1
: Process::CLOCK_PROF
FreeBSD 3.0, OpenBSD 2.1
: Process::CLOCK_REALTIME_FAST
FreeBSD 8.1
: Process::CLOCK_REALTIME_PRECISE
FreeBSD 8.1
: Process::CLOCK_REALTIME_COARSE
Lin... -
Kernel
. # at _ exit { . . . } -> Proc (14120.0) -
与えられたブロックをインタプリタ終了時に実行します。
..._exitがメソッドである点を除けば、END ブロックによる終了
処理の登録と同等です。登録した処理を取り消すことはできません。
spec/terminateも参照してください。
@return 登録した処理を Proc オブジェクトで返します。
//emlist......[例][ruby]{
3.times do |i|
at_exit{puts "at_exit#{i}"}
end
END{puts "END"}
at_exit{puts "at_exit"}
puts "main_end"
#=> main_end
# at_exit
# END
# at_exit2
# at_exit1
# at_exit0
//}
@see d:spec/control#END,Kernel.#exit!,Kernel.#fork... -
Thread
. report _ on _ exception -> bool (14114.0) -
真の時は、いずれかのスレッドが例外によって終了した時に、その内容を $stderr に報告します。
...。
Thread.new { 1.times { raise } }
は $stderr に以下のように出力します:
#<Thread:...> terminated with exception (report_on_exception is true):
Traceback (most recent call last):
2: from -e:1:in `block in <main>'
1: from -e:1:in `times'
これによって......了しないようにするのがより良い方法です。
* Thread#join や Thread#value でそのスレッドの終了を待つことが保証できるなら、
スレッド開始時に Thread.current.report_on_exception = false でレポートを無効化しても
安全です。しか......て
終了を待つことができなかったりするかもしれません。
スレッドごとに設定する方法は Thread#report_on_exception= を参照してください。
@param newstate スレッド実行中に例外発生した場合、その内容を報告するかどうかを tru... -
Thread
. report _ on _ exception=(newstate) (14114.0) -
真の時は、いずれかのスレッドが例外によって終了した時に、その内容を $stderr に報告します。
...。
Thread.new { 1.times { raise } }
は $stderr に以下のように出力します:
#<Thread:...> terminated with exception (report_on_exception is true):
Traceback (most recent call last):
2: from -e:1:in `block in <main>'
1: from -e:1:in `times'
これによって......了しないようにするのがより良い方法です。
* Thread#join や Thread#value でそのスレッドの終了を待つことが保証できるなら、
スレッド開始時に Thread.current.report_on_exception = false でレポートを無効化しても
安全です。しか......て
終了を待つことができなかったりするかもしれません。
スレッドごとに設定する方法は Thread#report_on_exception= を参照してください。
@param newstate スレッド実行中に例外発生した場合、その内容を報告するかどうかを tru... -
Enumerator
# with _ object(obj) -> Enumerator (14108.0) -
繰り返しの各要素に obj を添えてブロックを繰り返し、obj を返り値として返します。
...erator を返します。
//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_object("foo")
to_three_with_string.each do |x,string|
puts "#{string}: #{x}"
end
# => foo:0
# =>......foo:1
# => foo:2
//}
@param obj 繰り返しの各要素に添えて渡されるオブジェクト
@see Enumerable#each_with_object... -
Enumerator
# with _ object(obj) {|(*args) , memo _ obj| . . . } -> object (14108.0) -
繰り返しの各要素に obj を添えてブロックを繰り返し、obj を返り値として返します。
...erator を返します。
//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_object("foo")
to_three_with_string.each do |x,string|
puts "#{string}: #{x}"
end
# => foo:0
# =>......foo:1
# => foo:2
//}
@param obj 繰り返しの各要素に添えて渡されるオブジェクト
@see Enumerable#each_with_object...