種類
- モジュール関数 (66)
- インスタンスメソッド (12)
- 特異メソッド (11)
クラス
- CSV (11)
モジュール
- Exception2MessageMapper (12)
- Kernel (66)
検索結果
先頭5件
-
Exception2MessageMapper
# Fail(exception _ class = nil , *rest) -> () (18215.0) -
登録されている情報を使用して、例外を発生させます。
...在しない場合に発生します。
例:
class Foo
extend Exception2MessageMapper
p def_exception :NewExceptionClass, "message...%d, %d and %d" # =>
def foo
Raise NewExceptionClass, 1, 2, 3
end
end
Foo.new().foo() #=> in `Raise': message...1, 2 and 3 (Foo::N... -
Kernel
. # fail(error _ type , message = nil , backtrace = caller(0) , cause: $ !) -> () (6253.0) -
例外を発生させます。 発生した例外は変数 $! に格納されます。また例外が 発生した時のスタックトレースは変数 $@ に格納され ます。発生した例外は rescue 節で捕捉できます。
...させます。
//emlist[例][ruby]{
begin
open("nonexist")
rescue
raise #=> `open': No such file or directory - "nonexist" (Errno::ENOENT)
end
//}
引数を渡した場合は、例外メッセージ message を持った error_type の示す例外(省略時 RuntimeError)を
発生させま......r
ensure
p err #=> #<NameError: !!error!!>
end
//}
//emlist[例2][ruby]{
def foo num
print 'in method.'
raise "error!!" if num <= 9
rescue RuntimeError
num += 10
print 'in rescue.'
retry
else
print 'in else.'
ensure
print "in ensure.\n"
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......@param cause 現在の例外($!)の代わりに Exception#cause に設定する例外を指定します。
Exception オブジェクトまたは nil を指定できます。
@raise TypeError exception メソッドが例外オブジェクトを返さなかった場合に発生します。
例外... -
Kernel
. # fail -> () (6153.0) -
例外を発生させます。 発生した例外は変数 $! に格納されます。また例外が 発生した時のスタックトレースは変数 $@ に格納され ます。発生した例外は rescue 節で捕捉できます。
...させます。
//emlist[例][ruby]{
begin
open("nonexist")
rescue
raise #=> `open': No such file or directory - "nonexist" (Errno::ENOENT)
end
//}
引数を渡した場合は、例外メッセージ message を持った error_type の示す例外(省略時 RuntimeError)を
発生させま......@param cause 現在の例外($!)の代わりに Exception#cause に設定する例外を指定します。
Exception オブジェクトまたは nil を指定できます。
@raise TypeError exception メソッドが例外オブジェクトを返さなかった場合に発生します。
例外......r
ensure
p err #=> #<NameError: !!error!!>
end
//}
//emlist[例2][ruby]{
def foo num
print 'in method.'
raise "error!!" if num <= 9
rescue RuntimeError
num += 10
print 'in rescue.'
retry
else
print 'in else.'
ensure
print "in ensure.\n"
end
foo(4) #=> in method.in rescue.in method.... -
Kernel
. # fail(message , cause: $ !) -> () (6153.0) -
例外を発生させます。 発生した例外は変数 $! に格納されます。また例外が 発生した時のスタックトレースは変数 $@ に格納され ます。発生した例外は rescue 節で捕捉できます。
...させます。
//emlist[例][ruby]{
begin
open("nonexist")
rescue
raise #=> `open': No such file or directory - "nonexist" (Errno::ENOENT)
end
//}
引数を渡した場合は、例外メッセージ message を持った error_type の示す例外(省略時 RuntimeError)を
発生させま......@param cause 現在の例外($!)の代わりに Exception#cause に設定する例外を指定します。
Exception オブジェクトまたは nil を指定できます。
@raise TypeError exception メソッドが例外オブジェクトを返さなかった場合に発生します。
例外......r
ensure
p err #=> #<NameError: !!error!!>
end
//}
//emlist[例2][ruby]{
def foo num
print 'in method.'
raise "error!!" if num <= 9
rescue RuntimeError
num += 10
print 'in rescue.'
retry
else
print 'in else.'
ensure
print "in ensure.\n"
end
foo(4) #=> in method.in rescue.in method.... -
Kernel
. # fail -> () (6147.0) -
例外を発生させます。 発生した例外は変数 $! に格納されます。また例外が 発生した時のスタックトレースは変数 $@ に格納され ます。発生した例外は rescue 節で捕捉できます。
...させます。
//emlist[例][ruby]{
begin
open("nonexist")
rescue
raise #=> `open': No such file or directory - "nonexist" (Errno::ENOENT)
end
//}
引数を渡した場合は、例外メッセージ message を持った error_type の示す例外(省略時 RuntimeError)を
発生させま......r
ensure
p err #=> #<NameError: !!error!!>
end
//}
//emlist[例2][ruby]{
def foo num
print 'in method.'
raise "error!!" if num <= 9
rescue RuntimeError
num += 10
print 'in rescue.'
retry
else
print 'in else.'
ensure
print "in ensure.\n"
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: $ !) -> () (6147.0) -
例外を発生させます。 発生した例外は変数 $! に格納されます。また例外が 発生した時のスタックトレースは変数 $@ に格納され ます。発生した例外は rescue 節で捕捉できます。
...させます。
//emlist[例][ruby]{
begin
open("nonexist")
rescue
raise #=> `open': No such file or directory - "nonexist" (Errno::ENOENT)
end
//}
引数を渡した場合は、例外メッセージ message を持った error_type の示す例外(省略時 RuntimeError)を
発生させま......r
ensure
p err #=> #<NameError: !!error!!>
end
//}
//emlist[例2][ruby]{
def foo num
print 'in method.'
raise "error!!" if num <= 9
rescue RuntimeError
num += 10
print 'in rescue.'
retry
else
print 'in else.'
ensure
print "in ensure.\n"
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: $ !) -> () (3153.0) -
例外を発生させます。 発生した例外は変数 $! に格納されます。また例外が 発生した時のスタックトレースは変数 $@ に格納され ます。発生した例外は rescue 節で捕捉できます。
...させます。
//emlist[例][ruby]{
begin
open("nonexist")
rescue
raise #=> `open': No such file or directory - "nonexist" (Errno::ENOENT)
end
//}
引数を渡した場合は、例外メッセージ message を持った error_type の示す例外(省略時 RuntimeError)を
発生させま......r
ensure
p err #=> #<NameError: !!error!!>
end
//}
//emlist[例2][ruby]{
def foo num
print 'in method.'
raise "error!!" if num <= 9
rescue RuntimeError
num += 10
print 'in rescue.'
retry
else
print 'in else.'
ensure
print "in ensure.\n"
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......@param cause 現在の例外($!)の代わりに Exception#cause に設定する例外を指定します。
Exception オブジェクトまたは nil を指定できます。
@raise TypeError exception メソッドが例外オブジェクトを返さなかった場合に発生します。
例外... -
Exception2MessageMapper
# Raise(exception _ class = nil , *rest) -> () (3115.0) -
登録されている情報を使用して、例外を発生させます。
...在しない場合に発生します。
例:
class Foo
extend Exception2MessageMapper
p def_exception :NewExceptionClass, "message...%d, %d and %d" # =>
def foo
Raise NewExceptionClass, 1, 2, 3
end
end
Foo.new().foo() #=> in `Raise': message...1, 2 and 3 (Foo::N... -
Kernel
. # raise -> () (3053.0) -
例外を発生させます。 発生した例外は変数 $! に格納されます。また例外が 発生した時のスタックトレースは変数 $@ に格納され ます。発生した例外は rescue 節で捕捉できます。
...させます。
//emlist[例][ruby]{
begin
open("nonexist")
rescue
raise #=> `open': No such file or directory - "nonexist" (Errno::ENOENT)
end
//}
引数を渡した場合は、例外メッセージ message を持った error_type の示す例外(省略時 RuntimeError)を
発生させま......@param cause 現在の例外($!)の代わりに Exception#cause に設定する例外を指定します。
Exception オブジェクトまたは nil を指定できます。
@raise TypeError exception メソッドが例外オブジェクトを返さなかった場合に発生します。
例外......r
ensure
p err #=> #<NameError: !!error!!>
end
//}
//emlist[例2][ruby]{
def foo num
print 'in method.'
raise "error!!" if num <= 9
rescue RuntimeError
num += 10
print 'in rescue.'
retry
else
print 'in else.'
ensure
print "in ensure.\n"
end
foo(4) #=> in method.in rescue.in method.... -
Kernel
. # raise(message , cause: $ !) -> () (3053.0) -
例外を発生させます。 発生した例外は変数 $! に格納されます。また例外が 発生した時のスタックトレースは変数 $@ に格納され ます。発生した例外は rescue 節で捕捉できます。
...させます。
//emlist[例][ruby]{
begin
open("nonexist")
rescue
raise #=> `open': No such file or directory - "nonexist" (Errno::ENOENT)
end
//}
引数を渡した場合は、例外メッセージ message を持った error_type の示す例外(省略時 RuntimeError)を
発生させま......@param cause 現在の例外($!)の代わりに Exception#cause に設定する例外を指定します。
Exception オブジェクトまたは nil を指定できます。
@raise TypeError exception メソッドが例外オブジェクトを返さなかった場合に発生します。
例外......r
ensure
p err #=> #<NameError: !!error!!>
end
//}
//emlist[例2][ruby]{
def foo num
print 'in method.'
raise "error!!" if num <= 9
rescue RuntimeError
num += 10
print 'in rescue.'
retry
else
print 'in else.'
ensure
print "in ensure.\n"
end
foo(4) #=> in method.in rescue.in method.... -
Kernel
. # raise -> () (3047.0) -
例外を発生させます。 発生した例外は変数 $! に格納されます。また例外が 発生した時のスタックトレースは変数 $@ に格納され ます。発生した例外は rescue 節で捕捉できます。
...させます。
//emlist[例][ruby]{
begin
open("nonexist")
rescue
raise #=> `open': No such file or directory - "nonexist" (Errno::ENOENT)
end
//}
引数を渡した場合は、例外メッセージ message を持った error_type の示す例外(省略時 RuntimeError)を
発生させま......r
ensure
p err #=> #<NameError: !!error!!>
end
//}
//emlist[例2][ruby]{
def foo num
print 'in method.'
raise "error!!" if num <= 9
rescue RuntimeError
num += 10
print 'in rescue.'
retry
else
print 'in else.'
ensure
print "in ensure.\n"
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(message , cause: $ !) -> () (3047.0) -
例外を発生させます。 発生した例外は変数 $! に格納されます。また例外が 発生した時のスタックトレースは変数 $@ に格納され ます。発生した例外は rescue 節で捕捉できます。
...させます。
//emlist[例][ruby]{
begin
open("nonexist")
rescue
raise #=> `open': No such file or directory - "nonexist" (Errno::ENOENT)
end
//}
引数を渡した場合は、例外メッセージ message を持った error_type の示す例外(省略時 RuntimeError)を
発生させま......r
ensure
p err #=> #<NameError: !!error!!>
end
//}
//emlist[例2][ruby]{
def foo num
print 'in method.'
raise "error!!" if num <= 9
rescue RuntimeError
num += 10
print 'in rescue.'
retry
else
print 'in else.'
ensure
print "in ensure.\n"
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... -
CSV
. new(data , options = Hash . new) -> CSV (18.0) -
このメソッドは CSV ファイルを読み込んだり、書き出したりするために String か IO のインスタンスをラップします。
...r" の並びまでを読みます。
A sequence will be selected even if it occurs in a quoted field, assuming that you
would have the same line endings there. If none of those sequences is
found, +data+ is ARGF, Object::STDIN, Object::STDOUT, or
Object::STDERR, or the stream is only avail......t line ending beyond this
size.) If a quote cannot be found within the limit CSV will raise a
MalformedCSVError, assuming the data is faulty. You can use this limit to
prevent what are effectively DoS attacks on the parser. However, this
limit can cause a legitimate parse to fail and......thus is set to +nil+, or off,
by default.
: :converters
CSV::Converters から取り出した名前の配列です。変換器が一つだけ
の場合は配列に格納する必要はありません。
全ての組み込みの変換器は、値を変換する前に UTF-8 にエンコーデ...