ライブラリ
クラス
-
ARGF
. class (24) - Array (534)
- BasicObject (36)
- Binding (12)
- Complex (72)
- Data (3)
- Dir (92)
-
Encoding
:: Converter (24) - Enumerator (60)
-
Enumerator
:: Lazy (169) - Exception (104)
- Fiber (42)
- File (100)
-
File
:: Stat (12) - Float (45)
- FrozenError (6)
-
Gem
:: Installer (12) - Hash (56)
- IO (424)
-
IRB
:: ExtendCommand :: Load (12) - Integer (174)
- MatchData (102)
- Matrix (162)
- Module (276)
- Monitor (18)
- Mutex (4)
-
Net
:: HTTPResponse (12) - Numeric (93)
- Object (180)
-
OpenSSL
:: BN (204) - OptionParser (348)
- Pathname (36)
- Prime (12)
-
Rake
:: InvocationChain (12) - Random (36)
- Range (240)
- Rational (97)
- Regexp (12)
- Set (216)
- Socket (12)
- String (336)
- StringIO (304)
- StringScanner (60)
- Struct (36)
- Thread (60)
-
Thread
:: Mutex (20) - ThreadGroup (12)
- TracePoint (105)
- UnboundMethod (12)
- Vector (98)
- WIN32OLE (36)
-
WIN32OLE
_ TYPELIB (12)
モジュール
- Comparable (72)
- Enumerable (108)
- Kernel (12)
-
Net
:: HTTPHeader (72) -
OptionParser
:: Arguable (60) -
Rake
:: TaskManager (12) - TSort (35)
キーワード
- & (24)
- * (60)
- ** (13)
- + (24)
- - (24)
-
/ (12) - < (24)
- << (12)
- <= (24)
- <=> (12)
- == (24)
- === (12)
- =~ (24)
- > (24)
- >= (24)
- >> (12)
- [] (174)
- []= (134)
- ^ (12)
- accept (12)
- add (12)
- adjugate (12)
- advise (12)
-
angle
_ with (12) - antisymmetric? (7)
- append (12)
- at (12)
- atime (12)
- backtrace (12)
-
backtrace
_ locations (12) - begin (24)
- between? (12)
- bind (12)
- birthtime (12)
- bsearch (48)
- byteindex (3)
- byteoffset (6)
- bytes (14)
-
callee
_ id (12) - cause (12)
- ceil (12)
- children (19)
- chr (24)
- chunk (12)
- clamp (12)
-
class
_ variable _ get (12) -
clear
_ bit! (12) - clone (12)
-
close
_ write (12) - cmp (12)
- coerce (24)
-
cofactor
_ expansion (12) - collect (12)
- collect2 (24)
-
collect
_ concat (12) - combination (24)
- connect (12)
-
const
_ get (12) -
const
_ missing (12) -
content
_ length (12) - convert (12)
- ctime (12)
- cycle (12)
-
define
_ method (24) -
delete
_ at (12) -
deprecate
_ constant (12) - det (12)
- detect (24)
- determinant (12)
- difference (12)
- digits (24)
- disjoint? (12)
- drop (12)
- dup (12)
- each (132)
-
each
_ byte (48) -
each
_ child (14) -
each
_ line (84) - eigen (12)
- eigensystem (12)
- end (24)
- entries (19)
-
entrywise
_ product (8) -
enum
_ for (48) - environment (12)
-
eval
_ script (7) - event (12)
- exception (24)
- execute (12)
- exit (12)
- fcntl (12)
- fdatasync (12)
- feed (12)
- fetch (116)
-
fetch
_ values (20) - fileno (23)
- filter (7)
-
filter
_ map (6) - find (24)
-
find
_ all (12) - finish (12)
- first (48)
-
flat
_ map (12) - flatten (24)
- flatten! (24)
- flock (12)
- floor (12)
- gcd (12)
- gcdlcm (12)
- gem (12)
- getbyte (12)
- getc (12)
- getopts (36)
- gets (12)
-
hadamard
_ product (8) - hstack (12)
-
initialize
_ copy (12) - insert (12)
- inspect (24)
- install (12)
-
instance
_ eval (24) -
instance
_ method (12) -
instruction
_ sequence (7) - intersection (18)
- isatty (12)
- join (12)
-
laplace
_ expansion (12) - last (48)
- lcm (12)
- lineno (12)
- lines (14)
-
local
_ variable _ get (12) - lshift! (12)
- lstat (12)
- map (12)
- map2 (12)
-
mask
_ bits! (12) - max (70)
- merge (12)
- method (12)
-
method
_ id (12) -
method
_ missing (12) - min (70)
-
mod
_ add (12) -
mod
_ exp (12) -
mod
_ mul (12) -
mod
_ sub (12) -
mon
_ exit (6) - mtime (12)
- name= (10)
- next (12)
-
next
_ values (12) - normalize (12)
- offset (24)
-
ole
_ query _ interface (12) - on (144)
- ord (12)
- order (48)
- order! (48)
- parameters (7)
- parse (24)
- parse! (24)
- path (32)
- peek (24)
-
peek
_ values (12) - peep (12)
- permutation (24)
- permute (24)
- permute! (24)
- pid (12)
- pointer= (12)
- pop (12)
- pos (24)
- pos= (24)
- pow (24)
- pread (8)
-
prime
_ division (24) -
prime
_ fasttest? (12) - print (36)
- printf (12)
- private (48)
-
private
_ constant (12) -
proper
_ subset? (12) -
proper
_ superset? (12) - public (12)
-
public
_ constant (12) -
public
_ instance _ method (12) -
public
_ method (12) -
public
_ send (24) - putc (12)
- puts (12)
- pwrite (8)
- quo (12)
-
raised
_ exception (12) - rand (36)
- range (12)
-
range
_ length (12) - rationalize (24)
- read (12)
- readbyte (36)
- readchar (24)
- readline (12)
- readlines (48)
- receiver (6)
- regular? (12)
- reject (24)
-
relative
_ path _ from (12) -
remove
_ class _ variable (12) -
remove
_ const (12) -
remove
_ instance _ variable (12) -
remove
_ method (12) - reopen (48)
-
repeated
_ combination (24) -
repeated
_ permutation (24) - replace (24)
-
report
_ on _ exception (9) -
report
_ on _ exception= (9) -
respond
_ to? (12) - resume (12)
-
return
_ value (12) -
reverse
_ each (4) - rotate (12)
- rotate! (12)
- round (33)
- rshift! (12)
- run (12)
- sample (24)
- select (12)
-
set
_ backtrace (12) -
set
_ bit! (12) - setbyte (12)
- setproperty (24)
- shift (24)
-
singleton
_ class (12) -
singleton
_ method (12) - size (12)
-
skew
_ symmetric? (7) - sleep (12)
- slice (72)
- stat (12)
- step (103)
- subset? (12)
- subtract (12)
- superset? (12)
- synchronize (12)
-
synthesize
_ file _ task (12) - syswrite (12)
- take (12)
- tell (24)
-
to
_ a (7) -
to
_ d (36) -
to
_ enum (48) -
to
_ f (12) -
to
_ i (36) -
to
_ path (8) -
to
_ r (12) -
to
_ s (24) - tr (12)
- trace (12)
- transfer (12)
- truncate (36)
- tsort (12)
-
tsort
_ each (23) - tty? (12)
- ucmp (12)
-
undef
_ method (12) - ungetc (12)
-
unicode
_ normalize (11) -
unicode
_ normalize! (11) -
unicode
_ normalized? (11) - union (12)
- unscan (12)
- value (12)
-
values
_ at (12) - wakeup (12)
- with (3)
- write (24)
- zip (24)
- | (24)
検索結果
先頭5件
-
Fiber
# raise -> object (18228.0) -
selfが表すファイバーが最後に Fiber.yield を呼んだ場所で例外を発生させます。
...さない場合、RuntimeError が発生します。
message 引数を渡した場合、message 引数をメッセージとした RuntimeError
が発生します。
その他のケースでは、最初の引数は Exception か Exception
のインスタンスを返す exception メソッドを持......す。
@param exception 発生させる例外です。
@param backtrace 例外発生時のスタックトレースです。文字列の配列で指定します。
//emlist[例][ruby]{
f = Fiber.new { Fiber.yield }
f.resume
f.raise "Error!" # => Error! (RuntimeError)
//}
//emlist[ファイバー内......のイテレーションを終了させる例][ruby]{
f = Fiber.new do
loop do
Fiber.yield(:loop)
end
:exit
end
p f.resume # => :loop
p f.raise StopIteration # => :exit
//}... -
Fiber
# raise(exception , message = nil , backtrace = nil) -> object (18228.0) -
selfが表すファイバーが最後に Fiber.yield を呼んだ場所で例外を発生させます。
...さない場合、RuntimeError が発生します。
message 引数を渡した場合、message 引数をメッセージとした RuntimeError
が発生します。
その他のケースでは、最初の引数は Exception か Exception
のインスタンスを返す exception メソッドを持......す。
@param exception 発生させる例外です。
@param backtrace 例外発生時のスタックトレースです。文字列の配列で指定します。
//emlist[例][ruby]{
f = Fiber.new { Fiber.yield }
f.resume
f.raise "Error!" # => Error! (RuntimeError)
//}
//emlist[ファイバー内......のイテレーションを終了させる例][ruby]{
f = Fiber.new do
loop do
Fiber.yield(:loop)
end
:exit
end
p f.resume # => :loop
p f.raise StopIteration # => :exit
//}... -
Fiber
# raise(message) -> object (18228.0) -
selfが表すファイバーが最後に Fiber.yield を呼んだ場所で例外を発生させます。
...さない場合、RuntimeError が発生します。
message 引数を渡した場合、message 引数をメッセージとした RuntimeError
が発生します。
その他のケースでは、最初の引数は Exception か Exception
のインスタンスを返す exception メソッドを持......す。
@param exception 発生させる例外です。
@param backtrace 例外発生時のスタックトレースです。文字列の配列で指定します。
//emlist[例][ruby]{
f = Fiber.new { Fiber.yield }
f.resume
f.raise "Error!" # => Error! (RuntimeError)
//}
//emlist[ファイバー内......のイテレーションを終了させる例][ruby]{
f = Fiber.new do
loop do
Fiber.yield(:loop)
end
:exit
end
p f.resume # => :loop
p f.raise StopIteration # => :exit
//}... -
TracePoint
# raised _ exception -> Exception (12325.0) -
発生した例外を返します。
...ます。
@raise RuntimeError :raise イベントのためのイベントフックの外側で実行し
た場合に発生します。
//emlist[例][ruby]{
trace = TracePoint.new(:raise) do |tp|
tp.raised_exception # => #<ZeroDivisionError: divided by 0>
end
trace.enable
begi... -
TracePoint
# instruction _ sequence -> RubyVM :: InstructionSequence (9313.0) -
script_compiledイベント発生時にコンパイルされた RubyVM::InstructionSequenceインスタンスを返します。
...pt_compiledイベント発生時にコンパイルされた
RubyVM::InstructionSequenceインスタンスを返します。
//emlist[例][ruby]{
TracePoint.new(:script_compiled) do |tp|
p tp.instruction_sequence # => <RubyVM::InstructionSequence:block in <main>@(eval):1>
end.enable do
eval("put......s 'hello'")
end
//}
@raise RuntimeError :script_compiled イベントのための
イベントフックの外側で実行した場合に発生します。... -
Exception
# exception(error _ message) -> Exception (9219.0) -
引数を指定しない場合は self を返します。引数を指定した場合 自身のコピー を生成し Exception#message 属性を error_message にして返します。
...し Exception#message 属性を error_message にして返します。
Kernel.#raise は、実質的に、例外オブジェクトの exception
メソッドの呼び出しです。
@param error_message エラーメッセージを表す文字列を指定します。
//emlist[例][ruby]{
begin
#......... # 何か処理
rescue => e
raise e.exception("an error occurs during hogehoge process") # 詳しいエラーメッセージ
end
//}... -
Exception
# backtrace _ locations -> [Thread :: Backtrace :: Location] (9213.0) -
バックトレース情報を返します。Exception#backtraceに似ていますが、 Thread::Backtrace::Location の配列を返す点が異なります。
...ption#backtraceに似ていますが、
Thread::Backtrace::Location の配列を返す点が異なります。
現状では Exception#set_backtrace によって戻り値が変化する事はあり
ません。
//emlist[例: test.rb][ruby]{
require "date"
def check_long_month(month)
return if Dat......month, -1).day == 31
raise "#{month} is not long month"
end
def get_exception
return begin
yield
rescue => e
e
end
end
e = get_exception { check_long_month(2) }
p e.backtrace_locations
# => ["test.rb:4:in `check_long_month'", "test.rb:15:in `block in <main>'", "test.rb:9:in `get_ex......ception'", "test.rb:15:in `<main>'"]
//}
@see Exception#backtrace... -
Matrix
# entrywise _ product(m) -> Matrix (9213.0) -
アダマール積(要素ごとの積)を返します。
...ダマール積(要素ごとの積)を返します。
@raise ExceptionForMatrix::ErrDimensionMismatch 行や列の要素数が一致しない時に発生します。
//emlist[例][ruby]{
require 'matrix'
Matrix[[1,2], [3,4]].hadamard_product(Matrix[[1,2], [3,2]]) # => Matrix[[1, 4], [9, 8]]
//}... -
Gem
:: Installer # install -> Gem :: Specification (9125.0) -
Gem をインストールします。
...specifications/<gem-version>.gemspec #=> gemspec ファイル
@return ロードされた Gem::Specification のインスタンスを返します。
@raise Gem::InstallError 要求された Ruby のバージョンを満たしていない場合に発生します。
@raise Gem::InstallError 要......求された RubyGems のバージョンを満たしていない場合に発生します。
@raise Gem::InstallError Zlib::GzipFile::Error が発生した場合に発生します。... -
IRB
:: ExtendCommand :: Load # execute(file _ name , priv = nil) -> nil (9123.0) -
ファイル path を Ruby スクリプトとみなし、現在の irb インタプリタ上で実 行します。
...ファイル path を Ruby スクリプトとみなし、現在の irb インタプリタ上で実
行します。
Kernel.#load と異なり、path の内容を irb で一行ずつタイプしたかの
ように、irb 上で一行ずつ評価されます。
@param file_name ファイル名を文......字列で指定します。
@param priv 真を指定した場合は実行は内部的に生成される無名モジュール上
で行われ、グローバルな名前空間を汚染しません。
@raise LoadError 読み込みに失敗した場合に発生します。... -
Exception
# exception -> self (9119.0) -
引数を指定しない場合は self を返します。引数を指定した場合 自身のコピー を生成し Exception#message 属性を error_message にして返します。
...し Exception#message 属性を error_message にして返します。
Kernel.#raise は、実質的に、例外オブジェクトの exception
メソッドの呼び出しです。
@param error_message エラーメッセージを表す文字列を指定します。
//emlist[例][ruby]{
begin
#......... # 何か処理
rescue => e
raise e.exception("an error occurs during hogehoge process") # 詳しいエラーメッセージ
end
//}...