ライブラリ
キーワード
- DelegateClass (1)
- Digest (1)
- JSON (1)
-
arg
_ config (1) -
convertible
_ int (2) - j (1)
- jj (1)
-
psych
_ y (1) - time (1)
- timeout (2)
-
with
_ werror (2) - xmp (1)
- xpopen (2)
- y (1)
検索結果
先頭5件
-
Kernel
# JSON(object , options = {}) -> object (631.0) -
第一引数に与えられたオブジェクトの種類によって Ruby のオブジェクトか JSON 形式の文字列を返します。
第一引数に与えられたオブジェクトの種類によって Ruby のオブジェクトか JSON 形式の文字列を返します。
第一引数に文字列のようなオブジェクトを指定した場合は、それを JSON.#parse を用いてパースした結果を返します。
そうでないオブジェクトを指定した場合は、それを JSON.#generate を用いて変換した結果を返します。
@param object 任意のオブジェクトを指定します。
@param options JSON.#parse, JSON.#generate に渡すオプションを指定します。
//emlist[例][ruby]{
require "json... -
Kernel
# timeout(sec) {|i| . . . . } -> object (313.0) -
ブロックを sec 秒の期限付きで実行します。 ブロックの実行時間が制限を過ぎたときは例外 Timeout::Error が発生します。
ブロックを sec 秒の期限付きで実行します。
ブロックの実行時間が制限を過ぎたときは例外
Timeout::Error が発生します。
exception_class を指定した場合には Timeout::Error の代わりに
その例外が発生します。
ブロックパラメータ i は sec がはいります。
また sec が 0 もしくは nil のときは制限時間なしで
ブロックを実行します。
@param sec タイムアウトする時間を秒数で指定します.
@param exception_class タイムアウトした時、発生させる例外を指定します.
=== 注意
timeout に... -
Kernel
# timeout(sec , exception _ class = nil) {|i| . . . . } -> object (313.0) -
ブロックを sec 秒の期限付きで実行します。 ブロックの実行時間が制限を過ぎたときは例外 Timeout::Error が発生します。
ブロックを sec 秒の期限付きで実行します。
ブロックの実行時間が制限を過ぎたときは例外
Timeout::Error が発生します。
exception_class を指定した場合には Timeout::Error の代わりに
その例外が発生します。
ブロックパラメータ i は sec がはいります。
また sec が 0 もしくは nil のときは制限時間なしで
ブロックを実行します。
@param sec タイムアウトする時間を秒数で指定します.
@param exception_class タイムアウトした時、発生させる例外を指定します.
=== 注意
timeout に... -
Kernel
# with _ werror(opt , opts = nil) {|opt , opts| . . . } -> object (313.0) -
@todo 内部用?
@todo 内部用?
???
@param opt ????
@param opts ????
@return ブロックを評価した結果を返します。 -
Kernel
# with _ werror(opt , opts = nil) {|opt| . . . } -> object (313.0) -
@todo 内部用?
@todo 内部用?
???
@param opt ????
@param opts ????
@return ブロックを評価した結果を返します。 -
Kernel
# DelegateClass(superclass) -> object (310.0) -
クラス superclass のインスタンスへメソッドを委譲するクラスを定義し、 そのクラスを返します。
クラス superclass のインスタンスへメソッドを委譲するクラスを定義し、
そのクラスを返します。
@param superclass 委譲先となるクラス
例:
//emlist{
require 'delegate'
class ExtArray < DelegateClass(Array)
def initialize
super([])
end
end
a = ExtArray.new
p a.class # => ExtArray
a.push 25
p a # => [25]
//} -
Kernel
# Digest(name) -> object (310.0) -
"MD5"や"SHA1"などのダイジェストを示す文字列 name を指定し、 対応するダイジェストのクラスを取得します。
...で
Digest::MD5などを直接呼び出すと問題があるときはこのメソッドを使
うか、起動時に使用するライブラリを Kernel.#require してください。
@param name "MD5"や"SHA1"などのダイジェストを示す文字列を指定します。
@return Digest::MD5や... -
Kernel
# arg _ config(config , default) { . . . } -> object | String | true | nil (310.0) -
configure オプション --config の値を返します。
configure オプション --config の値を返します。
@param config オプションを文字列で指定します。
@param default 引数 config で指定したオプションのデフォルト値を指定します。
@return オプションが指定されてた場合は true を、指定されなかった場合は
nil を返します。
引数 default、あるいはブロックを指定すると、オプションが指定さ
れていない場合に引数 default の値かブロックの評価結果を返します
(両方指定した場合はブロックが優先されます)... -
Kernel
# time(msg , width = 25) { . . . } -> object (310.0) -
与えられたブロックの実行時間を計測して表示します。
与えられたブロックの実行時間を計測して表示します。
@param msg 表示するメッセージを指定します。
@param width 表示する幅を指定します。
@return ブロックの実行結果を返します。 -
Kernel
# xpopen(command , *mode) { . . . } -> object (310.0) -
command を表示してから IO.popen の実行します。
...command を表示してから IO.popen の実行します。
@param command コマンド名を指定します。
@param mode オープンする IO ポートのモードを指定します。mode の詳細は Kernel.#open 参照して下さい。
@see IO.popen... -
Kernel
# j(*objects) -> nil (307.0) -
与えられたオブジェクトを JSON 形式の文字列で標準出力に一行で出力します。
...トを JSON 形式の文字列で標準出力に一行で出力します。
@param objects JSON 形式で出力したいオブジェクトを指定します。
//emlist[例][ruby]{
require "json"
j([1,2,{"name" => "tanaka","age" => 19}])
# => [1,2,{"name":"tanaka","age":19}]
//}
@see Kernel.#p... -
Kernel
# jj(*objects) -> nil (307.0) -
与えられたオブジェクトを JSON 形式の文字列で標準出力に人間に読みやすく整形して出力します。
...します。
@param objects JSON 形式で出力したいオブジェクトを指定します。
//emlist[例][ruby]{
require "json"
jj([1,2,{"name" => "tanaka","age" => 19}])
# => [
# 1,
# 2,
# {
# "name": "tanaka",
# "age": 19
# }
# ]
//}
@see Kernel.#pp... -
Kernel
# psych _ y(*objects) -> String (307.0) -
objects を YAML document に変換します。
objects を YAML document に変換します。
このメソッドは irb 上でのみ定義されます。
syck に y メソッドがあるため、
psych_y が別名として定義されています。将来的に
syck が廃止された場合 psych_y は廃止
される予定であるため、特別の事情がない限り y を用いてください。
@param objects YAML document に変換する Ruby のオブジェクト -
Kernel
# y(*objects) -> String (307.0) -
objects を YAML document に変換します。
objects を YAML document に変換します。
このメソッドは irb 上でのみ定義されます。
syck に y メソッドがあるため、
psych_y が別名として定義されています。将来的に
syck が廃止された場合 psych_y は廃止
される予定であるため、特別の事情がない限り y を用いてください。
@param objects YAML document に変換する Ruby のオブジェクト -
Kernel
# convertible _ int(type , headers = nil , opts = nil) (55.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... -
Kernel
# convertible _ int(type , headers = nil , opts = nil) { . . . } (55.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... -
Kernel
# xmp(exps , bind = nil) -> XMP (25.0) -
引数 exps で指定されたRuby のソースコードとその実行結果を、標準出力に行 ごとに交互に表示します。
...定します。
@param bind Binding オブジェクトを指定します。省略した場合は、最
後に実行した XMP#puts、Kernel#xmp の
Binding を使用します。まだ何も実行していない場合は
Object::TOPLEVEL_BINDING を使用します... -
Kernel
# xpopen(command , *mode) -> IO (10.0) -
command を表示してから IO.popen の実行します。
...command を表示してから IO.popen の実行します。
@param command コマンド名を指定します。
@param mode オープンする IO ポートのモードを指定します。mode の詳細は Kernel.#open 参照して下さい。
@see IO.popen...