種類
クラス
-
ARGF
. class (176) - BasicObject (22)
- File (33)
- IO (44)
- Method (11)
- Module (132)
- Object (132)
- Thread (22)
-
Thread
:: Backtrace :: Location (11) - TracePoint (11)
- Tracer (22)
- UnboundMethod (11)
モジュール
- Exception2MessageMapper (18)
- Kernel (198)
- Timeout (19)
キーワード
-
$ ERROR _ INFO (11) -
$ ERROR _ POSITION (11) -
$ FILENAME (11) - ARGF (22)
- BasicObject (11)
- DelegateClass (11)
- Location (11)
-
NEWS for Ruby 2
. 0 . 0 (11) -
NEWS for Ruby 2
. 1 . 0 (11) -
NEWS for Ruby 2
. 3 . 0 (9) -
NEWS for Ruby 2
. 4 . 0 (8) -
NEWS for Ruby 2
. 5 . 0 (7) -
NEWS for Ruby 2
. 6 . 0 (6) -
NEWS for Ruby 2
. 7 . 0 (5) -
NEWS for Ruby 3
. 0 . 0 (4) -
NEWS for Ruby 3
. 1 . 0 (3) - Ruby用語集 (11)
- String (11)
-
add
_ filter (22) -
add
_ trace _ func (11) - ancestors (11)
- autoload (22)
- autoload? (11)
-
class
_ eval (22) -
class
_ variables (11) -
const
_ defined? (11) - constants (22)
-
def
_ exception (6) -
defined
_ class (11) -
drb
/ extservm (11) - fail (33)
-
for
_ fd (11) - gets (33)
-
global
_ variables (11) - include (11)
- inspect (11)
-
instance
_ eval (22) -
instance
_ variables (11) - irb (11)
-
local
_ variables (11) -
minitest
/ unit (1) -
module
_ eval (22) - new (22)
- open (44)
- owner (22)
- pp (11)
-
pretty
_ print (11) - print (11)
- printf (11)
- putc (11)
- puts (11)
- raise (33)
- readline (33)
- readlines (33)
-
remove
_ const (11) -
ruby 1
. 6 feature (11) -
ruby 1
. 8 . 2 feature (11) -
ruby 1
. 8 . 4 feature (11) -
ruby 1
. 9 feature (11) - send (22)
-
set
_ trace _ func (22) -
singleton
_ method (11) - timeout (41)
-
to
_ a (33) -
to
_ ary (11) -
to
_ int (11) -
to
_ s (22) -
to
_ str (11) - tracer (11)
- クラス/メソッドの定義 (11)
- 制御構造 (11)
- 変数と定数 (11)
検索結果
先頭5件
-
Kernel
# DelegateClass(superclass) -> object (27212.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 (21113.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 (21072.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 (21040.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
. # autoload(const _ name , feature) -> nil (21034.0) -
定数 const_name を最初に参照した時に feature を Kernel.#require するように設定します。
...定数 const_name を最初に参照した時に feature を
Kernel.#require するように設定します。
const_name には、 "::" 演算子を含めることはできません。
ネストした定数を指定する方法は Module#autoload を参照してください。
const_name が aut......対象を指定します。
@raise LoadError featureのロードに失敗すると発生します。
//emlist[][ruby]{
# ------- /tmp/foo.rb ---------
class Bar
end
# ----- end of /tmp/foo.rb ----
autoload :Bar, '/tmp/foo'
p Bar #=> Bar
//}
@see Kernel.#autoload?,Module#autoload,Kernel.#require... -
Kernel
. # fail -> () (21018.0) -
例外を発生させます。 発生した例外は変数 $! に格納されます。また例外が 発生した時のスタックトレースは変数 $@ に格納され ます。発生した例外は rescue 節で捕捉できます。
...します。
@param message 例外のメッセージとなる文字列です。
@param backtrace 例外発生時のスタックトレースで、Kernel.#caller の戻り値と同じ
形式で指定しなければいけません。
@param cause 現在の例外($!)の代わりに Exception#cause に......end
foo(4) #=> in method.in rescue.in method.in else.in ensure.
//}
//emlist[例3][ruby]{
class MyException
def exception(mesg=nil)
SecurityError.new(mesg)
end
end
begin
raise MyException.new
rescue SecurityError
p $! #=> #<SecurityError: SecurityError>
end
//}
@see Kernel.#caller... -
Kernel
. # fail(error _ type , message = nil , backtrace = caller(0) , cause: $ !) -> () (21018.0) -
例外を発生させます。 発生した例外は変数 $! に格納されます。また例外が 発生した時のスタックトレースは変数 $@ に格納され ます。発生した例外は rescue 節で捕捉できます。
...します。
@param message 例外のメッセージとなる文字列です。
@param backtrace 例外発生時のスタックトレースで、Kernel.#caller の戻り値と同じ
形式で指定しなければいけません。
@param cause 現在の例外($!)の代わりに Exception#cause に......end
foo(4) #=> in method.in rescue.in method.in else.in ensure.
//}
//emlist[例3][ruby]{
class MyException
def exception(mesg=nil)
SecurityError.new(mesg)
end
end
begin
raise MyException.new
rescue SecurityError
p $! #=> #<SecurityError: SecurityError>
end
//}
@see Kernel.#caller... -
Kernel
. # fail(message , cause: $ !) -> () (21018.0) -
例外を発生させます。 発生した例外は変数 $! に格納されます。また例外が 発生した時のスタックトレースは変数 $@ に格納され ます。発生した例外は rescue 節で捕捉できます。
...します。
@param message 例外のメッセージとなる文字列です。
@param backtrace 例外発生時のスタックトレースで、Kernel.#caller の戻り値と同じ
形式で指定しなければいけません。
@param cause 現在の例外($!)の代わりに Exception#cause に......end
foo(4) #=> in method.in rescue.in method.in else.in ensure.
//}
//emlist[例3][ruby]{
class MyException
def exception(mesg=nil)
SecurityError.new(mesg)
end
end
begin
raise MyException.new
rescue SecurityError
p $! #=> #<SecurityError: SecurityError>
end
//}
@see Kernel.#caller... -
Kernel
. # raise -> () (21018.0) -
例外を発生させます。 発生した例外は変数 $! に格納されます。また例外が 発生した時のスタックトレースは変数 $@ に格納され ます。発生した例外は rescue 節で捕捉できます。
...します。
@param message 例外のメッセージとなる文字列です。
@param backtrace 例外発生時のスタックトレースで、Kernel.#caller の戻り値と同じ
形式で指定しなければいけません。
@param cause 現在の例外($!)の代わりに Exception#cause に......end
foo(4) #=> in method.in rescue.in method.in else.in ensure.
//}
//emlist[例3][ruby]{
class MyException
def exception(mesg=nil)
SecurityError.new(mesg)
end
end
begin
raise MyException.new
rescue SecurityError
p $! #=> #<SecurityError: SecurityError>
end
//}
@see Kernel.#caller... -
Kernel
. # raise(error _ type , message = nil , backtrace = caller(0) , cause: $ !) -> () (21018.0) -
例外を発生させます。 発生した例外は変数 $! に格納されます。また例外が 発生した時のスタックトレースは変数 $@ に格納され ます。発生した例外は rescue 節で捕捉できます。
...します。
@param message 例外のメッセージとなる文字列です。
@param backtrace 例外発生時のスタックトレースで、Kernel.#caller の戻り値と同じ
形式で指定しなければいけません。
@param cause 現在の例外($!)の代わりに Exception#cause に......end
foo(4) #=> in method.in rescue.in method.in else.in ensure.
//}
//emlist[例3][ruby]{
class MyException
def exception(mesg=nil)
SecurityError.new(mesg)
end
end
begin
raise MyException.new
rescue SecurityError
p $! #=> #<SecurityError: SecurityError>
end
//}
@see Kernel.#caller...