種類
- モジュール関数 (242)
- インスタンスメソッド (88)
- 変数 (73)
ライブラリ
- English (44)
- ビルトイン (249)
- bigdecimal (22)
- mkmf (88)
キーワード
-
$ $ (11) -
$ . (11) -
$ INPUT _ LINE _ NUMBER (11) -
$ NR (11) -
$ PID (11) -
$ PROCESS _ ID (11) -
$ SAFE (7) - BigDecimal (22)
- Rational (11)
-
check
_ signedness (22) -
check
_ sizeof (22) -
convertible
_ int (22) - fork (22)
- format (11)
- putc (11)
- rand (22)
- sleep (22)
- spawn (44)
- sprintf (11)
- srand (22)
- syscall (11)
- test (22)
-
try
_ constant (22)
検索結果
先頭5件
-
Kernel
. # sleep -> Integer (103.0) -
sec 秒だけプログラムの実行を停止します。
sec 秒だけプログラムの実行を停止します。
sec が省略された場合、他スレッドからの Thread#run
などで明示的に起こさない限り永久にスリープします。Thread#runを呼ぶとその時点で
sleepの実行が中断されます。
@param sec 停止する秒数を非負の数値で指定します。浮動小数点数も指定できます。
省略された場合、永久にスリープします。
@return 実際に停止していた秒数 (整数に丸められた値) です。
//emlist[例][ruby]{
it = Thread.new do
sleep
puts 'it_end'
end... -
Kernel
. # sleep(sec) -> Integer (103.0) -
sec 秒だけプログラムの実行を停止します。
sec 秒だけプログラムの実行を停止します。
sec が省略された場合、他スレッドからの Thread#run
などで明示的に起こさない限り永久にスリープします。Thread#runを呼ぶとその時点で
sleepの実行が中断されます。
@param sec 停止する秒数を非負の数値で指定します。浮動小数点数も指定できます。
省略された場合、永久にスリープします。
@return 実際に停止していた秒数 (整数に丸められた値) です。
//emlist[例][ruby]{
it = Thread.new do
sleep
puts 'it_end'
end... -
Kernel
. # srand -> Integer (103.0) -
Kernel.#rand や Random.rand で使用される擬似乱数生成器の種を設定し、古い種を返します。
...
Kernel.#rand や Random.rand で使用される擬似乱数生成器の種を設定し、古い種を返します。
seed に整数を指定するとその絶対値を乱数の種に設定します。
それ以外の値を指定した場合は seed.to_int が指定されたものとして扱いま......す。
seed に既知の値を与えると、以前の Kernel.#rand の値を再現できます。
seed が省略された時には
現在の時刻やプロセス ID、srand を呼び出した回数、
また可能なら /dev/urandom から読み出したデータなどを元に種を作ります......) #=> 0.938911141393347
p rand(0) #=> 0.915824970865251
seeds << srand(num)
p rand(6) #=> 3
p rand(6) #=> 0
p rand(0) #=> 0.445804380918972
p rand(0) #=> 0.422248634121701
seeds << srand
p seeds #=> [455675, 2995620310703489221660585195204777696, 455675]
//}
@see Kernel.#rand, Random::DEFAULT... -
Kernel
. # srand(seed) -> Integer (103.0) -
Kernel.#rand や Random.rand で使用される擬似乱数生成器の種を設定し、古い種を返します。
...
Kernel.#rand や Random.rand で使用される擬似乱数生成器の種を設定し、古い種を返します。
seed に整数を指定するとその絶対値を乱数の種に設定します。
それ以外の値を指定した場合は seed.to_int が指定されたものとして扱いま......す。
seed に既知の値を与えると、以前の Kernel.#rand の値を再現できます。
seed が省略された時には
現在の時刻やプロセス ID、srand を呼び出した回数、
また可能なら /dev/urandom から読み出したデータなどを元に種を作ります......) #=> 0.938911141393347
p rand(0) #=> 0.915824970865251
seeds << srand(num)
p rand(6) #=> 3
p rand(6) #=> 0
p rand(0) #=> 0.445804380918972
p rand(0) #=> 0.422248634121701
seeds << srand
p seeds #=> [455675, 2995620310703489221660585195204777696, 455675]
//}
@see Kernel.#rand, Random::DEFAULT... -
Kernel
$ $ $ -> Integer (102.0) -
現在実行中の Ruby プロセスのプロセス ID です。 Process.#pid と同じです。
現在実行中の Ruby プロセスのプロセス ID です。
Process.#pid と同じです。
この変数はグローバルスコープです。 -
Kernel
$ $ . -> Integer (102.0) -
いずれかの IO オブジェクトが最後に読んだ行の行番号です。 Object::ARGF などの IO 互換のオブジェクトも $. を更新します。
いずれかの IO オブジェクトが最後に読んだ行の行番号です。
Object::ARGF などの IO 互換のオブジェクトも $. を更新します。
IO からの読み込みが起きるタイミングが予測不能であるような複雑なプログラムでは使用すべきではありません。特に、マルチスレッドプログラムではスレッド間で競合を起こす可能性があります。
そのような場合には、 IO#lineno を使用してください。
この変数はグローバルスコープです。
Ruby起動時の初期値は 0 です。 -
Kernel
$ $ SAFE -> Integer (102.0) -
カレントスレッドのセーフレベルを表す整数です。
カレントスレッドのセーフレベルを表す整数です。
セーフレベルについてはspec/safelevel を参照してください。
Thread.current.safe_level と同じです。
非整数を代入しようとすると TypeError が発生します。
この変数はスレッドローカルです。
Ruby起動時の初期値は 0 です。カレントプロセスのセーフレベルを表す整数です。
セーフレベルについてはspec/safelevel を参照してください。
Thread.current.safe_level と同じです。
非整数を代入しようとすると TypeError が発生します。
この変数はグローバルスコープです。
Ruby起動時の初期値は 0 です。 -
Kernel
. # syscall(num , *arg) -> Integer (102.0) -
numで指定された番号のシステムコールを実行します。 第2引数以降をシステムコールの引数として渡します。
numで指定された番号のシステムコールを実行します。
第2引数以降をシステムコールの引数として渡します。
どの数値がどのシステムコールに対応するかは、
syscall(2) や
/usr/include/sys/syscall.h を参照してください。
システムコールの慣習に従い、syscall(2)
が -1 を返す場合には例外 Errno::EXXX が発生します。
それ以外では、返した値をそのまま数値で返します。
ライブラリ fiddle を使えばより高レベルな操作ができます。
@param num システムコール番号です。
@param arg 文字列か、整数です。最大 9 ... -
Kernel
# convertible _ int(type , headers = nil , opts = nil) (49.0) -
Returns the convertible integer type of the given +type+. You may optionally specify additional +headers+ to search in for the +type+. _Convertible_ means actually same type, or typedefed from same type. If the +type+ is a integer type and _convertible_ type is found, following macros are passed as preprocessor constants to the compiler using the +type+ name, in uppercase. * 'TYPEOF_', followed by the +type+ name, followed by '=X' where 'X' is the found _convertible_ type name. * 'TYP2NUM' and 'NUM2TYP, where 'TYP' is the +type+ name in uppercase with replacing '_t' suffix with 'T', followed by '=X' where 'X' is the macro name to convert +type+ to +Integer+ object, and vice versa. For example, if foobar_t is defined as unsigned long, then convertible_int("foobar_t") would return "unsigned long", and define macros: #define TYPEOF_FOOBAR_T unsigned long #define FOOBART2NUM ULONG2NUM #define NUM2FOOBART NUM2ULONG
...Returns the convertible integer type of the given +type+. You may
optionally specify additional +headers+ to search in for the +type+.
_Convertible_ means actually same type, or typedefed from same type.
If the +type+ is a integer type and _convertible_ type is found,
following macros are p......TYP' is the +type+ name in uppercase with replacing '_t'
suffix with 'T', followed by '=X' where 'X' is the macro name to
convert +type+ to +Integer+ object, and vice versa.
For example, if foobar_t is defined as unsigned long, then
convertible_int("foobar_t") would return "unsigned long",... -
Kernel
# convertible _ int(type , headers = nil , opts = nil) { . . . } (49.0) -
Returns the convertible integer type of the given +type+. You may optionally specify additional +headers+ to search in for the +type+. _Convertible_ means actually same type, or typedefed from same type. If the +type+ is a integer type and _convertible_ type is found, following macros are passed as preprocessor constants to the compiler using the +type+ name, in uppercase. * 'TYPEOF_', followed by the +type+ name, followed by '=X' where 'X' is the found _convertible_ type name. * 'TYP2NUM' and 'NUM2TYP, where 'TYP' is the +type+ name in uppercase with replacing '_t' suffix with 'T', followed by '=X' where 'X' is the macro name to convert +type+ to +Integer+ object, and vice versa. For example, if foobar_t is defined as unsigned long, then convertible_int("foobar_t") would return "unsigned long", and define macros: #define TYPEOF_FOOBAR_T unsigned long #define FOOBART2NUM ULONG2NUM #define NUM2FOOBART NUM2ULONG
...Returns the convertible integer type of the given +type+. You may
optionally specify additional +headers+ to search in for the +type+.
_Convertible_ means actually same type, or typedefed from same type.
If the +type+ is a integer type and _convertible_ type is found,
following macros are p......TYP' is the +type+ name in uppercase with replacing '_t'
suffix with 'T', followed by '=X' where 'X' is the macro name to
convert +type+ to +Integer+ object, and vice versa.
For example, if foobar_t is defined as unsigned long, then
convertible_int("foobar_t") would return "unsigned long",...