種類
- インスタンスメソッド (4115)
- モジュール関数 (1682)
- 特異メソッド (1601)
- クラス (44)
- 変数 (22)
クラス
-
ARGF
. class (101) - Array (489)
- BasicObject (33)
- Binding (11)
- Complex (66)
- Data (8)
- Dir (369)
- Encoding (11)
-
Encoding
:: Converter (22) - Enumerator (60)
-
Enumerator
:: Lazy (173) - Exception (95)
- Fiber (40)
- File (412)
-
File
:: Stat (22) - Float (19)
- FrozenError (5)
- Hash (106)
- IO (1195)
- Integer (157)
- KeyError (14)
- MatchData (81)
- Module (276)
- Mutex (8)
- Numeric (84)
- Object (165)
- Proc (29)
- Random (62)
- Range (227)
- Rational (77)
- Regexp (33)
- String (289)
- Struct (66)
- SystemCallError (55)
- SystemExit (11)
- Thread (169)
-
Thread
:: Mutex (36) - ThreadGroup (11)
- Time (124)
- TracePoint (117)
- UnboundMethod (11)
モジュール
- Comparable (65)
- Enumerable (143)
- FileTest (162)
- Kernel (706)
- Marshal (22)
- Math (99)
- ObjectSpace (44)
- Process (352)
-
Process
:: GID (88) -
Process
:: Sys (165) -
Process
:: UID (77) -
RubyVM
:: AbstractSyntaxTree (16) -
RubyVM
:: MJIT (12) - Signal (22)
キーワード
-
$ ! (11) -
$ @ (11) - & (11)
- * (33)
- ** (11)
- + (11)
- - (11)
-
/ (11) - < (22)
- << (11)
- <= (22)
- == (22)
- === (22)
- =~ (22)
- > (22)
- >= (22)
- Array (11)
- Complex (22)
- Fiber (11)
- Float (11)
- Hash (11)
- Integer (11)
- Rational (11)
- RuntimeError (11)
- String (11)
- Thread (11)
- TracePoint (11)
- [] (180)
- []= (88)
-
_ id2ref (11) - ` (11)
- abort (22)
-
absolute
_ path? (5) - add (11)
- advise (11)
- at (11)
- atime (22)
- autoload (11)
- backtrace (11)
-
backtrace
_ locations (11) - begin (22)
- between? (11)
- bind (11)
- binmode (11)
- birthtime (31)
- blockdev? (11)
- bsearch (44)
- byteindex (2)
- byteoffset (4)
- bytes (14)
- bytesplice (4)
-
callee
_ id (11) - caller (33)
- cause (11)
- ceil (11)
-
change
_ privilege (22) - chardev? (11)
- chars (14)
- chdir (22)
- children (20)
- chmod (22)
- chown (22)
- chr (22)
- chunk (11)
-
chunk
_ while (8) - clamp (10)
-
class
_ variable _ get (11) -
clock
_ gettime (11) - clone (22)
- close (15)
-
close
_ read (11) -
close
_ write (11) - coerce (11)
- collect (11)
-
collect
_ concat (11) - combination (22)
- compile (11)
-
const
_ get (11) -
const
_ missing (11) - convert (11)
-
count
_ objects (11) - ctime (22)
- cycle (22)
- daemon (11)
- define (4)
-
define
_ finalizer (22) -
define
_ method (44) - delete (22)
-
delete
_ at (11) -
deprecate
_ constant (9) - detach (11)
- detect (22)
- digits (22)
- directory? (11)
- dirname (3)
- drop (11)
- dup (22)
- each (110)
-
each
_ byte (22) -
each
_ char (22) -
each
_ child (40) -
each
_ line (66) - egid= (11)
- eid (11)
- eid= (22)
- empty? (8)
- end (22)
- entries (28)
-
enum
_ for (44) - eof (22)
- eof? (22)
- erf (11)
- erfc (11)
- errno (11)
- euid= (11)
- eval (22)
-
eval
_ script (6) - event (11)
- exception (22)
- exec (44)
- exist? (11)
- exp (11)
- fail (33)
- fcntl (11)
- feed (11)
- fetch (106)
-
fetch
_ values (18) - file? (11)
- fileno (32)
- filter (6)
-
filter
_ map (5) - find (33)
-
find
_ all (11) - finish (11)
- first (33)
-
flat
_ map (11) - flatten (11)
- flatten! (11)
- flock (11)
- floor (11)
- flush (11)
-
for
_ fd (11) - foreach (66)
- fork (55)
- frexp (11)
-
from
_ name (22) - ftype (11)
- gamma (11)
- gcd (11)
- gcdlcm (11)
- getc (11)
- getegid (11)
- geteuid (11)
- getgid (11)
- getpgid (11)
- getpgrp (11)
- getpriority (11)
- getrlimit (11)
- gets (44)
- getsid (11)
- getuid (11)
- getwd (11)
- gid= (11)
- gm (22)
-
grant
_ privilege (22) - groups (11)
- groups= (11)
- grpowned? (11)
-
handle
_ interrupt (11) - identical? (11)
- include (22)
- initgroups (11)
-
initialize
_ copy (11) - insert (11)
- inspect (22)
-
instance
_ eval (22) -
instance
_ method (11) -
instruction
_ sequence (6) - intersection (5)
- ioctl (11)
- issetugid (11)
- join (44)
- key (7)
- kill (11)
- lambda (17)
- last (33)
- lchmod (11)
- lchown (11)
- lcm (11)
- ldexp (11)
- lgamma (11)
- lineno (22)
- lineno= (11)
- lines (42)
- link (11)
- load (22)
- local (22)
-
local
_ variable _ get (11) - lock (11)
- log (22)
- loop (22)
- lstat (22)
- lutime (7)
- map (11)
- max (86)
- maxgroups (11)
- maxgroups= (11)
- method (11)
-
method
_ id (11) -
method
_ missing (11) - min (86)
- mkdir (11)
- mktime (22)
- mtime (22)
- name= (9)
- new (245)
- next (11)
-
next
_ values (11) - now (11)
- offset (22)
- open (110)
- ord (11)
- owned? (11)
- p (11)
- parameters (6)
- parse (8)
-
parse
_ file (8) - path (18)
- pause (6)
- peek (11)
-
peek
_ values (11) -
pending
_ interrupt? (11) - permutation (22)
- pid (11)
- pipe (88)
- pipe? (11)
- pop (11)
- popen (154)
- pos (22)
- pow (22)
- pread (7)
- print (11)
- printf (22)
- private (46)
-
private
_ constant (11) - proc (18)
- produce (5)
- protected (23)
- public (42)
-
public
_ constant (11) -
public
_ instance _ method (11) -
public
_ method (11) -
public
_ send (22) - putc (22)
- puts (11)
- pwd (11)
- pwrite (7)
- quo (11)
-
raised
_ exception (11) - rand (55)
- rationalize (22)
-
re
_ exchange (22) - read (55)
-
read
_ nonblock (11) - readbyte (22)
- readchar (22)
- readline (77)
- readlines (77)
- readlink (11)
- readpartial (11)
- realdirpath (11)
- realpath (11)
- receiver (12)
- rehash (11)
- reject (11)
-
remove
_ class _ variable (11) -
remove
_ const (11) -
remove
_ instance _ variable (11) -
remove
_ method (11) - rename (11)
- reopen (33)
-
repeated
_ combination (22) -
repeated
_ permutation (22) - replace (11)
-
report
_ on _ exception (16) -
report
_ on _ exception= (16) - require (11)
-
require
_ relative (11) -
respond
_ to? (11) - restore (11)
- resume (17)
-
return
_ value (11) - rewind (22)
- rmdir (11)
- rotate (11)
- rotate! (11)
- round (30)
- run (11)
- sample (44)
- seek (22)
- select (22)
-
set
_ backtrace (11) -
set
_ trace _ func (11) - setbyte (11)
- setegid (11)
- seteuid (11)
- setgid (11)
- setpgid (11)
- setpgrp (11)
- setpriority (11)
- setregid (11)
- setresgid (11)
- setresuid (11)
- setreuid (11)
- setrgid (11)
- setrlimit (22)
- setruid (11)
- setsid (11)
- setuid (11)
- setuid? (11)
- shift (11)
-
singleton
_ class (11) -
singleton
_ method (11) - size (22)
- size? (11)
- sleep (11)
- slice (66)
- socket? (11)
- spawn (55)
- sqrt (7)
- start (11)
- stat (22)
- status (22)
- step (94)
- sub (22)
- switch (44)
- symlink (11)
- sync= (11)
- synchronize (11)
- syscall (11)
- sysopen (11)
- sysread (11)
- sysseek (11)
- system (44)
- syswrite (11)
- take (11)
- tell (22)
- throw (11)
- times (11)
-
to
_ a (6) -
to
_ enum (44) -
to
_ f (11) -
to
_ i (44) -
to
_ path (7) -
to
_ r (11) -
to
_ s (11) - trace (11)
- transfer (3)
- trap (22)
- truncate (33)
-
try
_ convert (3) - uid= (11)
-
undef
_ method (11) - ungetc (11)
-
unicode
_ normalize (10) -
unicode
_ normalize! (10) -
unicode
_ normalized? (10) - unlink (22)
- unlock (11)
- urandom (7)
- utc (22)
- utime (11)
-
values
_ at (11) - wait (11)
- wait2 (11)
- waitpid (11)
- waitpid2 (11)
- wakeup (11)
- warn (11)
- write (11)
-
write
_ nonblock (11) - yield (22)
- zero? (11)
- zip (11)
- | (11)
検索結果
先頭5件
-
Thread
# raise(error _ type , message , traceback) -> () (32227.0) -
自身が表すスレッドで強制的に例外を発生させます。
...@param error_type Kernel.#raise を参照してください。
@param message Kernel.#raise を参照してください。
@param traceback Kernel.#raise を参照してください。
Thread.new {
sleep 1
Thread.main.raise "foobar"
}
begin
sleep
rescue
p $!, $@
end......=> #<RuntimeError: foobar>
["-:3"]... -
Fiber
# raise -> object (32217.0) -
selfが表すファイバーが最後に Fiber.yield を呼んだ場所で例外を発生させます。
...elfが表すファイバーが最後に Fiber.yield を呼んだ場所で例外を発生させます。
Fiber.yield が呼ばれていないかファイバーがすでに終了している場合、
FiberError が発生します。
引数を渡さない場合、RuntimeError が発生します。
me......ssage 引数を渡した場合、message 引数をメッセージとした RuntimeError
が発生します。
その他のケースでは、最初の引数は Exception か Exception
のインスタンスを返す exception メソッドを持ったオブジェクトである
必要があります......message 例外のメッセージとなる文字列です。
@param exception 発生させる例外です。
@param backtrace 例外発生時のスタックトレースです。文字列の配列で指定します。
//emlist[例][ruby]{
f = Fiber.new { Fiber.yield }
f.resume
f.raise "Error!" # => E... -
Fiber
# raise(exception , message = nil , backtrace = nil) -> object (32217.0) -
selfが表すファイバーが最後に Fiber.yield を呼んだ場所で例外を発生させます。
...elfが表すファイバーが最後に Fiber.yield を呼んだ場所で例外を発生させます。
Fiber.yield が呼ばれていないかファイバーがすでに終了している場合、
FiberError が発生します。
引数を渡さない場合、RuntimeError が発生します。
me......ssage 引数を渡した場合、message 引数をメッセージとした RuntimeError
が発生します。
その他のケースでは、最初の引数は Exception か Exception
のインスタンスを返す exception メソッドを持ったオブジェクトである
必要があります......message 例外のメッセージとなる文字列です。
@param exception 発生させる例外です。
@param backtrace 例外発生時のスタックトレースです。文字列の配列で指定します。
//emlist[例][ruby]{
f = Fiber.new { Fiber.yield }
f.resume
f.raise "Error!" # => E... -
Fiber
# raise(message) -> object (32217.0) -
selfが表すファイバーが最後に Fiber.yield を呼んだ場所で例外を発生させます。
...elfが表すファイバーが最後に Fiber.yield を呼んだ場所で例外を発生させます。
Fiber.yield が呼ばれていないかファイバーがすでに終了している場合、
FiberError が発生します。
引数を渡さない場合、RuntimeError が発生します。
me......ssage 引数を渡した場合、message 引数をメッセージとした RuntimeError
が発生します。
その他のケースでは、最初の引数は Exception か Exception
のインスタンスを返す exception メソッドを持ったオブジェクトである
必要があります......message 例外のメッセージとなる文字列です。
@param exception 発生させる例外です。
@param backtrace 例外発生時のスタックトレースです。文字列の配列で指定します。
//emlist[例][ruby]{
f = Fiber.new { Fiber.yield }
f.resume
f.raise "Error!" # => E... -
Kernel
. # raise -> () (29235.0) -
例外を発生させます。 発生した例外は変数 $! に格納されます。また例外が 発生した時のスタックトレースは変数 $@ に格納され ます。発生した例外は rescue 節で捕捉できます。
...外は rescue 節で捕捉できます。
引数無しの場合は、同スレッドの同じブロック内で最後に rescue された
例外オブジェクト ($!) を再発生させます。そのような
例外が存在しないが自身は捕捉されている時には例外 RuntimeError......//emlist[例][ruby]{
begin
open("nonexist")
rescue
raise #=> `open': No such file or directory - "nonexist" (Errno::ENOENT)
end
//}
引数を渡した場合は、例外メッセージ message を持った error_type の示す例外(省略時 RuntimeError)を
発生させます。
error_type......トを指定した場合、
そのオブジェクトの exception メソッドが返す値を発生する例外にします。
その際、exception メソッドに引数として変数 message を渡すことができます。
@param error_type 発生させる例外を例外クラスまたは例... -
Kernel
. # raise(error _ type , message = nil , backtrace = caller(0) , cause: $ !) -> () (29235.0) -
例外を発生させます。 発生した例外は変数 $! に格納されます。また例外が 発生した時のスタックトレースは変数 $@ に格納され ます。発生した例外は rescue 節で捕捉できます。
...外は rescue 節で捕捉できます。
引数無しの場合は、同スレッドの同じブロック内で最後に rescue された
例外オブジェクト ($!) を再発生させます。そのような
例外が存在しないが自身は捕捉されている時には例外 RuntimeError......//emlist[例][ruby]{
begin
open("nonexist")
rescue
raise #=> `open': No such file or directory - "nonexist" (Errno::ENOENT)
end
//}
引数を渡した場合は、例外メッセージ message を持った error_type の示す例外(省略時 RuntimeError)を
発生させます。
error_type......トを指定した場合、
そのオブジェクトの exception メソッドが返す値を発生する例外にします。
その際、exception メソッドに引数として変数 message を渡すことができます。
@param error_type 発生させる例外を例外クラスまたは例... -
Kernel
. # raise(message , cause: $ !) -> () (29235.0) -
例外を発生させます。 発生した例外は変数 $! に格納されます。また例外が 発生した時のスタックトレースは変数 $@ に格納され ます。発生した例外は rescue 節で捕捉できます。
...外は rescue 節で捕捉できます。
引数無しの場合は、同スレッドの同じブロック内で最後に rescue された
例外オブジェクト ($!) を再発生させます。そのような
例外が存在しないが自身は捕捉されている時には例外 RuntimeError......//emlist[例][ruby]{
begin
open("nonexist")
rescue
raise #=> `open': No such file or directory - "nonexist" (Errno::ENOENT)
end
//}
引数を渡した場合は、例外メッセージ message を持った error_type の示す例外(省略時 RuntimeError)を
発生させます。
error_type......トを指定した場合、
そのオブジェクトの exception メソッドが返す値を発生する例外にします。
その際、exception メソッドに引数として変数 message を渡すことができます。
@param error_type 発生させる例外を例外クラスまたは例... -
TracePoint
# raised _ exception -> Exception (23220.0) -
発生した例外を返します。
...@raise RuntimeError :raise イベントのためのイベントフックの外側で実行し
た場合に発生します。
//emlist[例][ruby]{
trace = TracePoint.new(:raise) do |tp|
tp.raised_exception # => #<ZeroDivisionError: divided by 0>
end
trace.enable
begin
0/0
res......cue
end
//}... -
Object
# singleton _ method(name) -> Method (17308.0) -
オブジェクトの特異メソッド name をオブジェクト化した Method オブ ジェクトを返します。
...name をオブジェクト化した Method オブ
ジェクトを返します。
@param name メソッド名をSymbol またはStringで指定します。
@raise NameError 定義されていないメソッド名を引数として与えると発生します。
//emlist[][ruby]{
class Demo
def in......e(n)
@iv = n
end
def hello()
"Hello, @iv = #{@iv}"
end
end
k = Demo.new(99)
def k.hi
"Hi, @iv = #{@iv}"
end
m = k.singleton_method(:hi) # => #<Method: #<Demo:0xf8b0c3c4 @iv=99>.hi>
m.call #=> "Hi, @iv = 99"
m = k.singleton_method(:hello) # => NameError
//}
@see Module#instance......_method, Method, BasicObject#__send__, Object#send, Kernel.#eval, Object#method... -
Exception
# exception(error _ message) -> Exception (17226.0) -
引数を指定しない場合は self を返します。引数を指定した場合 自身のコピー を生成し Exception#message 属性を error_message にして返します。
...合は self を返します。引数を指定した場合 自身のコピー
を生成し 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
//}... -
Kernel
. # Integer(arg , base = 0) -> Integer (17220.0) -
引数を整数(Fixnum,Bignum)に変換した結果を返します。
...に対しては arg.to_int, arg.to_i を
この順に使用して変換します。
@param arg 変換対象のオブジェクトです。
@param base 基数として0か2から36の整数を指定します(引数argに文字列を指
定した場合のみ)。省略するか0を指定......数) です。
@raise ArgumentError 整数と見なせない文字列を引数に指定した場合に発生します。
@raise TypeError メソッド to_int, to_i を持たないオブジェクトを引数に指定したか、to_int, to_i
が整数(Integerのサブクラス)を返さ......@raise TypeError 引数に nil を指定した場合に発生します。
//emlist[例][ruby]{
p Integer(4) #=> 4
p Integer(4_000) #=> 4000
p Integer(9.88) #=> 9
p Integer(nil) # can't convert nil into Integer (TypeError)
p Integer(Object.new) # cannot convert Object in... -
Kernel
. # Integer(arg , base = 0 , exception: true) -> Integer | nil (17220.0) -
引数を整数(Fixnum,Bignum)に変換した結果を返します。
...に対しては arg.to_int, arg.to_i を
この順に使用して変換します。
@param arg 変換対象のオブジェクトです。
@param base 基数として0か2から36の整数を指定します(引数argに文字列を指
定した場合のみ)。省略するか0を指定......です。
@param exception false を指定すると、変換できなかった場合、
例外を発生する代わりに nil を返します。
@raise ArgumentError 整数と見なせない文字列を引数に指定した場合に発生します。
@raise TypeError メソッド......(Integerのサブクラス)を返さなかった場合に発生します。
@raise TypeError 引数に nil を指定した場合に発生します。
//emlist[例][ruby]{
p Integer(4) #=> 4
p Integer(4_000) #=> 4000
p Integer(9.88) #=> 9
p Integer(nil) # can't convert ni...