ライブラリ
- ビルトイン (4921)
クラス
-
ARGF
. class (110) - Array (606)
- BasicObject (36)
- Binding (12)
- Complex (72)
- Data (3)
- Dir (130)
-
Encoding
:: Converter (24) - Enumerator (60)
-
Enumerator
:: Lazy (178) - Exception (104)
- Fiber (34)
- File (135)
-
File
:: Stat (12) - Float (21)
- FrozenError (6)
- Hash (68)
- IO (974)
- Integer (162)
- KeyError (16)
- MatchData (102)
- Module (372)
- Mutex (8)
- Numeric (93)
- Object (180)
- Proc (48)
- Random (48)
- Range (242)
- Rational (85)
- Regexp (12)
- Set (57)
- String (346)
- Struct (36)
- SystemCallError (12)
- SystemExit (12)
- Thread (108)
-
Thread
:: Mutex (40) - ThreadGroup (12)
- TracePoint (105)
- UnboundMethod (12)
モジュール
- Comparable (72)
- Enumerable (156)
キーワード
- & (15)
- * (36)
- ** (13)
- + (15)
- - (15)
-
/ (12) - < (24)
- << (12)
- <= (24)
- == (24)
- === (24)
- =~ (24)
- > (24)
- >= (24)
- [] (198)
- []= (132)
- ^ (3)
- add (12)
- advise (12)
- at (12)
- atime (12)
- backtrace (12)
-
backtrace
_ locations (12) - begin (24)
- between? (12)
- bind (12)
- binmode (12)
- birthtime (23)
- bsearch (48)
- byteindex (3)
- byteoffset (6)
- bytes (14)
- bytesplice (10)
- call (12)
-
callee
_ id (12) - cause (12)
- ceil (12)
- chars (14)
- children (7)
- chmod (12)
- chown (12)
- chr (24)
- chunk (12)
-
chunk
_ while (9) - clamp (12)
-
class
_ variable _ get (12) - clone (24)
- close (16)
-
close
_ read (12) -
close
_ write (12) - coerce (12)
- collect (12)
-
collect
_ concat (12) - combination (24)
-
const
_ get (12) -
const
_ missing (12) - convert (12)
- ctime (12)
- cycle (24)
-
define
_ method (24) -
delete
_ at (12) -
deprecate
_ constant (12) - detect (24)
- difference (3)
- digits (24)
- disjoint? (3)
- drop (12)
- dup (24)
- each (120)
-
each
_ byte (24) -
each
_ char (24) -
each
_ child (14) -
each
_ line (72) - end (24)
- entries (7)
-
enum
_ for (48) - eof (24)
- eof? (24)
- errno (12)
-
eval
_ script (7) - event (12)
- exception (24)
- fcntl (12)
- fdatasync (12)
- feed (12)
- fetch (80)
-
fetch
_ values (20) - fileno (35)
- filter (7)
-
filter
_ map (6) - find (24)
-
find
_ all (12) - finish (12)
- first (48)
-
flat
_ map (12) - flatten (15)
- flatten! (15)
- flock (12)
- floor (12)
- flush (12)
- fsync (12)
- gcd (12)
- gcdlcm (12)
- getc (12)
- gets (36)
- include (12)
-
initialize
_ copy (12) - insert (12)
- inspect (24)
-
instance
_ eval (24) -
instance
_ method (12) -
instruction
_ sequence (7) - intersect? (3)
- intersection (9)
- ioctl (12)
- isatty (12)
- join (36)
- key (8)
- last (48)
- lcm (12)
- lineno (24)
- lineno= (12)
- lines (42)
-
local
_ variable _ get (12) - lock (12)
- lstat (12)
- map (12)
-
marshal
_ load (12) - max (94)
- merge (3)
- method (12)
-
method
_ id (12) -
method
_ missing (12) - min (94)
- mtime (12)
- name= (10)
- next (12)
-
next
_ values (12) - offset (24)
- ord (12)
- overlap? (2)
- parameters (7)
- path (20)
- peek (12)
-
peek
_ values (12) - permutation (24)
- pid (12)
- pop (24)
- pos (24)
- pos= (24)
- pow (24)
- pread (8)
- print (12)
- printf (12)
- private (48)
-
private
_ constant (12) -
proper
_ subset? (3) -
proper
_ superset? (3) - protected (48)
- public (48)
-
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)
- rationalize (24)
- read (24)
-
read
_ nonblock (12) - readbyte (24)
- readchar (24)
- readline (72)
- readlines (36)
- readpartial (12)
- receiver (14)
- rehash (12)
- reject (12)
-
remove
_ class _ variable (12) -
remove
_ const (12) -
remove
_ instance _ variable (12) -
remove
_ method (12) - reopen (36)
-
repeated
_ combination (24) -
repeated
_ permutation (24) - replace (15)
-
report
_ on _ exception (9) -
report
_ on _ exception= (9) -
respond
_ to? (12) - resume (12)
-
return
_ value (12) -
reverse
_ each (4) - rewind (24)
- rotate (12)
- rotate! (12)
- round (33)
- run (12)
- sample (48)
- seek (24)
- select (12)
-
set
_ backtrace (12) - setbyte (12)
- shift (24)
-
singleton
_ class (12) -
singleton
_ method (12) - size (12)
- sleep (12)
- slice (72)
- stat (12)
- status (24)
- step (103)
- subset? (3)
- subtract (3)
- superset? (3)
- sync (12)
- sync= (12)
- synchronize (12)
- sysread (12)
- sysseek (12)
- syswrite (12)
- take (12)
- tell (24)
-
to
_ a (7) -
to
_ enum (48) -
to
_ f (12) -
to
_ i (48) -
to
_ path (8) -
to
_ r (12) -
to
_ s (12) - transfer (4)
- truncate (24)
- tty? (12)
-
undef
_ method (12) - ungetc (12)
-
unicode
_ normalize (11) -
unicode
_ normalize! (11) -
unicode
_ normalized? (11) - union (3)
- unlock (12)
-
values
_ at (12) - wakeup (12)
- with (3)
- write (12)
-
write
_ nonblock (12) - yield (12)
- zip (24)
- | (15)
検索結果
先頭5件
-
Thread
# raise(error _ type , message , traceback) -> () (26126.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... -
Fiber
# raise -> object (26116.0) -
selfが表すファイバーが最後に Fiber.yield を呼んだ場所で例外を発生させます。
...ew { 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 (26116.0) -
selfが表すファイバーが最後に Fiber.yield を呼んだ場所で例外を発生させます。
...ew { 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 (26116.0) -
selfが表すファイバーが最後に Fiber.yield を呼んだ場所で例外を発生させます。
...ew { 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 (14119.0) -
発生した例外を返します。
...発生した例外を返します。
@raise RuntimeError :raise イベントのためのイベントフックの外側で実行し
た場合に発生します。
//emlist[例][ruby]{
trace = TracePoint.new(:raise) do |tp|
tp.raised_exception # => #<ZeroDivisionError: divided... -
IO
# advise(advice , offset=0 , len=0) -> nil (8031.0) -
posix_fadvise(2) を呼びだし、 ファイルへのアクセスパターンをOSに知らせます。
...を指定するデータの長さ
@raise IOError ストリームが既に閉じられているときに発生する例外
@raise Errno::EBADF ファイルデスクリプタが不正であるときに発生する例外
@raise Errno::EINVAL advice が不正
@raise Errno::ESPIPE ファイルデスク......リプタが FIFO か pipe を指している
場合に発生する例外(Linux はこの場合には Errno::EINVAL を発生する)
@raise RangeError offset,lenが有効範囲から出ている場合に発生する例外
//emlist[例][ruby]{
File.open("testfile") { |f| p f.advise(:sequentia... -
Array
# []=(start , length , val) (8028.0) -
インデックス start から length 個の要素を配列 val の内容で置き換えます。 start が自身の末尾を越える時には配列の長さを自動的に拡張し、拡張した領域を nil で初期化します。
...= [0, 1, 2, 3, 4, 5]
a[2, 3] = []
p a # => [0, 1, 5]
//}
@raise TypeError 引数 start、length に整数以外の(暗黙の型変換が行えな
い)オブジェクトを指定した場合に発生します。
@raise TypeError 引数 val に配列以外の(暗黙の型変換......が行えない)オブジェ
クトを指定した場合に発生します。
@raise IndexError 引数 start が自身の始点よりも前を指している場合に発生します。
@raise IndexError 引数 length に負の数を指定した場合に発生します。... -
BasicObject
# instance _ eval {|obj| . . . } -> object (8019.0) -
オブジェクトのコンテキストで文字列 expr またはオブジェクト自身をブロックパラメータとするブロックを 評価してその結果を返します。
...XX"
some.instance_eval{do_fuga } #=> "secret" # private メソッドも呼び出せる
some.instance_eval 'raise' # ..:10: (eval):1: (RuntimeError)
messg = 'unknown'
some.instance_eval 'raise messg','file.rb',999 # file.rb:999: unknown (RuntimeError)
//}
//emlist[例][ruby]{
class Bar < BasicObje......ct
def call1
instance_eval("::ENV.class")
end
def call2
instance_eval("ENV.class")
end
end
bar = Bar.new
bar.call1 # => Object
bar.call2 # raise NameError
//}
@see Module#module_eval, Kernel.#eval, BasicObject#instance_exec... -
BasicObject
# instance _ eval(expr , filename = "(eval)" , lineno = 1) -> object (8019.0) -
オブジェクトのコンテキストで文字列 expr またはオブジェクト自身をブロックパラメータとするブロックを 評価してその結果を返します。
...XX"
some.instance_eval{do_fuga } #=> "secret" # private メソッドも呼び出せる
some.instance_eval 'raise' # ..:10: (eval):1: (RuntimeError)
messg = 'unknown'
some.instance_eval 'raise messg','file.rb',999 # file.rb:999: unknown (RuntimeError)
//}
//emlist[例][ruby]{
class Bar < BasicObje......ct
def call1
instance_eval("::ENV.class")
end
def call2
instance_eval("ENV.class")
end
end
bar = Bar.new
bar.call1 # => Object
bar.call2 # raise NameError
//}
@see Module#module_eval, Kernel.#eval, BasicObject#instance_exec... -
File
# birthtime -> Time (8019.0) -
作成された時刻を Time オブジェクトとして返します。
...た時刻を Time オブジェクトとして返します。
@raise IOError 自身が close されている場合に発生します。
@raise Errno::EXXX ファイルの時刻の取得に失敗した場合に発生します。
@raise NotImplementedError Windows のような birthtime のない...