208件ヒット
[1-100件を表示]
(0.016秒)
種類
- モジュール関数 (144)
- 変数 (36)
- インスタンスメソッド (28)
キーワード
-
$ ERROR _ INFO (12) -
$ ERROR _ POSITION (12) -
$ FILENAME (12) - DelegateClass (12)
- String (12)
- autoload (12)
- autoload? (12)
- fail (36)
-
global
_ variables (12) -
local
_ variables (12) - raise (36)
-
set
_ trace _ func (12) - timeout (16)
検索結果
先頭5件
-
Kernel
# DelegateClass(superclass) -> object (6213.0) -
クラス superclass のインスタンスへメソッドを委譲するクラスを定義し、 そのクラスを返します。
...クラス superclass のインスタンスへメソッドを委譲するクラスを定義し、
そのクラスを返します。
@param superclass 委譲先となるクラス
例:
//emlist{
require 'delegate'
class ExtArray < DelegateClass(Array)
def initialize
super([])
end
end
a = E......xtArray.new
p a.class # => ExtArray
a.push 25
p a # => [25]
//}... -
Kernel
# timeout(sec , exception _ class = nil) {|i| . . . . } -> object (114.0) -
ブロックを sec 秒の期限付きで実行します。 ブロックの実行時間が制限を過ぎたときは例外 Timeout::Error が発生します。
...期限付きで実行します。
ブロックの実行時間が制限を過ぎたときは例外
Timeout::Error が発生します。
exception_class を指定した場合には Timeout::Error の代わりに
その例外が発生します。
ブロックパラメータ i は sec がはいりま......は制限時間なしで
ブロックを実行します。
@param sec タイムアウトする時間を秒数で指定します.
@param exception_class タイムアウトした時、発生させる例外を指定します.
=== 注意
timeout による割り込みは Thread によって実現さ... -
Kernel
. # set _ trace _ func(proc) -> Proc (61.0) -
Ruby インタプリタのイベントをトレースする Proc オブジェクトとして 指定された proc を登録します。 nil を指定するとトレースがオフになります。
...c-call": Cで記述されたメソッドの呼び出し。
"c-return": Cで記述されたメソッド呼び出しからのリターン。
"class": クラス定義、特異クラス定義、モジュール定義への突入。
"end": クラス定義、特異クラス定義、モ......ルでは nil。
call/return/c-call/c-return
呼び出された/リターンするメソッドを表す Symbol オブジェクト。
class/end
nil。
raise
最後に呼び出されたメソッドを表す Symbol オブジェクト。
トップレベルで......
class Foo
end
43.to_s
# ----結果----
# ["c-return", "..", 1, :set_trace_func, #<Binding:0xf6ceb8>, Kernel]
# ["line", "..", 4, nil, #<Binding:0x10cbcd8>, nil]
# ["c-call", "..", 4, :inherited, #<Binding:0x10cba98>, Class]
# ["c-return", "..", 4, :inherited, #<Binding:0x10cb858>, Class]
# ["class... -
Kernel
. # autoload?(const _ name) -> String | nil (19.0) -
const_name が Kernel.#autoload 設定されているか調べます。
...const_name が Kernel.#autoload 設定されているか調べます。
autoload 設定されていて、autoload 定数がまだ定義されてない(ロードされていない)
ときにそのパス名を返します。
autoload 設定されていないか、ロード済みなら nil を返し......-----
class Foo
class Bar
end
end
# ----- end of /tmp/foo.rb ----
class Foo
end
p Foo.autoload?(:Bar) #=> nil
Foo.autoload :Bar, '/tmp/foo'
p Foo.autoload?(:Bar) #=> "/tmp/foo"
p Foo::Bar #=> Foo::Bar
p Foo.autoload?(:Bar) #=> nil
//}
@see Kernel.#aut... -
Kernel
$ $ FILENAME -> String (17.0) -
仮想ファイル Object::ARGF で現在読み込み中のファイル名です。 ARGF.class#filename と同じです。
...仮想ファイル Object::ARGF で現在読み込み中のファイル名です。
ARGF.class#filename と同じです。
この変数はグローバルスコープです。... -
Kernel
# timeout(sec) {|i| . . . . } -> object (14.0) -
ブロックを sec 秒の期限付きで実行します。 ブロックの実行時間が制限を過ぎたときは例外 Timeout::Error が発生します。
...期限付きで実行します。
ブロックの実行時間が制限を過ぎたときは例外
Timeout::Error が発生します。
exception_class を指定した場合には Timeout::Error の代わりに
その例外が発生します。
ブロックパラメータ i は sec がはいりま......は制限時間なしで
ブロックを実行します。
@param sec タイムアウトする時間を秒数で指定します.
@param exception_class タイムアウトした時、発生させる例外を指定します.
=== 注意
timeout による割り込みは Thread によって実現さ... -
Kernel
$ $ ERROR _ INFO -> Exception | nil (7.0) -
$! の別名
...$! の別名
require "English"
class SomethingError < StandardError; end
begin
raise SomethingError
rescue
p $ERROR_INFO.backtrace #=> ["sample.rb:5"]
p $ERROR_INFO.to_s #=> "SomethingError"
end... -
Kernel
$ $ ERROR _ POSITION -> [String] | nil (7.0) -
$@ の別名
...$@ の別名
require "English"
class SomethingError < StandardError; end
begin
raise SomethingError
rescue
p $ERROR_POSITION #=> ["sample.rb:5"]
end... -
Kernel
. # String(arg) -> String (7.0) -
引数を文字列(String)に変換した結果を返します。
...arg を返します。
@param arg 変換対象のオブジェクトです。
@raise TypeError to_s の返り値が文字列でなければ発生します。
//emlist[例][ruby]{
class Foo
def to_s
"hogehoge"
end
end
arg = Foo.new
p String(arg) #=> "hogehoge"
//}
@see Object#to_s,String...