別のキーワード
ライブラリ
クラス
- Array (512)
- BasicObject (36)
- Binding (12)
- Complex (36)
- Data (3)
-
Encoding
:: Converter (12) - Enumerator (12)
-
Enumerator
:: Lazy (24) - Exception (56)
- Fiber (42)
- File (12)
- Float (45)
- Hash (56)
- IO (268)
-
IRB
:: ExtendCommand :: Load (12) - Integer (138)
- MatchData (106)
- Matrix (36)
- Module (276)
- Mutex (2)
- Numeric (93)
- Object (156)
-
OpenSSL
:: BN (204) - OptionParser (348)
- Pathname (24)
- Prime (12)
-
Rake
:: InvocationChain (12) - Random (36)
- Range (160)
- Rational (97)
- Regexp (12)
- Set (192)
- Socket (12)
- String (324)
- StringIO (218)
- StringScanner (48)
- Struct (36)
- Thread (26)
-
Thread
:: Mutex (10) - ThreadGroup (12)
- TracePoint (7)
- UnboundMethod (12)
- Vector (86)
- WIN32OLE (36)
モジュール
- Comparable (72)
- Enumerable (96)
- Kernel (12)
-
Net
:: HTTPHeader (36) -
OptionParser
:: Arguable (12) -
Rake
:: TaskManager (12)
キーワード
- & (24)
- * (60)
- ** (13)
- + (24)
- - (24)
-
/ (12) - < (24)
- << (12)
- <= (24)
- <=> (12)
- == (24)
- === (12)
- =~ (24)
- > (24)
- >= (24)
- >> (12)
- [] (174)
- []= (134)
- ^ (12)
- accept (12)
- add (12)
- advise (12)
-
angle
_ with (12) - append (12)
- at (12)
- begin (24)
- between? (12)
- bind (12)
- bytebegin (2)
- byteend (2)
- byteindex (3)
- byteoffset (6)
- ceil (12)
- children (12)
- chr (24)
- clamp (12)
-
class
_ variable _ get (12) -
clear
_ bit! (12) - clone (12)
- cmp (12)
- coerce (12)
-
cofactor
_ expansion (12) - collect2 (24)
- combination (24)
- connect (12)
-
const
_ get (12) -
const
_ missing (12) - convert (12)
- cycle (12)
-
define
_ method (24) -
delete
_ at (12) -
deprecate
_ constant (12) - detect (24)
- difference (12)
- digits (24)
- disjoint? (12)
- drop (12)
- dup (12)
- each (84)
-
each
_ line (84) - end (24)
-
enum
_ for (24) - environment (12)
- exception (24)
- execute (12)
- fcntl (12)
- feed (12)
- fetch (116)
-
fetch
_ values (22) - find (24)
- first (48)
- flatten (12)
- flatten! (12)
- flock (12)
- floor (12)
- gem (12)
- getopts (36)
- gets (12)
- hstack (12)
- insert (12)
- inspect (12)
-
instance
_ eval (24) -
instance
_ method (12) - intersection (18)
- join (12)
-
laplace
_ expansion (12) - last (48)
- lines (14)
-
local
_ variable _ get (12) - lshift! (12)
- map2 (12)
-
mask
_ bits! (12) - max (68)
- merge (12)
- method (12)
-
method
_ missing (12) - min (68)
-
mod
_ add (12) -
mod
_ exp (12) -
mod
_ mul (12) -
mod
_ sub (12) - offset (24)
-
ole
_ query _ interface (12) - on (144)
- order (48)
- order! (24)
- parameters (7)
- parse (24)
- parse! (12)
- peek (12)
- peep (12)
- permutation (24)
- permute (24)
- permute! (12)
- pointer= (12)
- pop (12)
- 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)
- rand (36)
- rationalize (24)
- readline (12)
- readlines (48)
- reject (12)
-
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)
- rotate (12)
- rotate! (12)
- round (33)
- rshift! (12)
- sample (24)
-
set
_ backtrace (12) -
set
_ bit! (12) - setbyte (12)
- setproperty (24)
- shift (24)
-
singleton
_ method (12) - sleep (12)
- slice (72)
- step (93)
- subset? (12)
- subtract (12)
- superset? (12)
-
synthesize
_ file _ task (12) - syswrite (12)
- take (12)
-
to
_ d (36) -
to
_ enum (24) -
to
_ i (12) -
to
_ r (12) -
to
_ s (24) - transfer (12)
- truncate (24)
- ucmp (12)
-
undef
_ method (12) - ungetc (12)
-
unicode
_ normalize (11) -
unicode
_ normalize! (11) -
unicode
_ normalized? (11) - union (12)
-
values
_ at (12) - with (3)
- write (24)
- zip (24)
- | (24)
検索結果
先頭5件
-
Fiber
# raise -> object (18246.0) -
selfが表すファイバーが最後に Fiber.yield を呼んだ場所で例外を発生させます。
...さない場合、RuntimeError が発生します。
message 引数を渡した場合、message 引数をメッセージとした RuntimeError
が発生します。
その他のケースでは、最初の引数は Exception か Exception
のインスタンスを返す exception メソッドを持......@param message 例外のメッセージとなる文字列です。
@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 (18246.0) -
selfが表すファイバーが最後に Fiber.yield を呼んだ場所で例外を発生させます。
...さない場合、RuntimeError が発生します。
message 引数を渡した場合、message 引数をメッセージとした RuntimeError
が発生します。
その他のケースでは、最初の引数は Exception か Exception
のインスタンスを返す exception メソッドを持......@param message 例外のメッセージとなる文字列です。
@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 (18246.0) -
selfが表すファイバーが最後に Fiber.yield を呼んだ場所で例外を発生させます。
...さない場合、RuntimeError が発生します。
message 引数を渡した場合、message 引数をメッセージとした RuntimeError
が発生します。
その他のケースでは、最初の引数は Exception か Exception
のインスタンスを返す exception メソッドを持......@param message 例外のメッセージとなる文字列です。
@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
# parameters -> [object] (12213.0) -
現在のフックが属するメソッドまたはブロックのパラメータ定義を返します。 フォーマットは Method#parameters と同じです。
...は Method#parameters と同じです。
@raise RuntimeError :call、:return、:b_call、:b_return、:c_call、:c_return
イベントのためのイベントフックの外側で実行した場合に発生します。
//emlist[例][ruby]{
def foo(a, b = 2)
end
TracePoint.new(:c......all) do |tp|
p tp.parameters # => a], [:opt, :b
end.enable do
foo(1)
end
//}
@see Method#parameters, UnboundMethod#parameters, Proc#parameters... -
Exception
# exception(error _ message) -> Exception (9225.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
//}... -
IRB
:: ExtendCommand :: Load # execute(file _ name , priv = nil) -> nil (9135.0) -
ファイル path を Ruby スクリプトとみなし、現在の irb インタプリタ上で実 行します。
...ファイル path を Ruby スクリプトとみなし、現在の irb インタプリタ上で実
行します。
Kernel.#load と異なり、path の内容を irb で一行ずつタイプしたかの
ように、irb 上で一行ずつ評価されます。
@param file_name ファイル名を文......字列で指定します。
@param priv 真を指定した場合は実行は内部的に生成される無名モジュール上
で行われ、グローバルな名前空間を汚染しません。
@raise LoadError 読み込みに失敗した場合に発生します。... -
Exception
# exception -> self (9125.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
//}... -
StringIO
# truncate(len) -> Integer (9125.0) -
自身のサイズが len になるように、自身を切り詰め、もしくは拡大します。 拡大した場合は、その部分を 0 で埋めます。 len を返します。
...@param len 変更したいサイズを整数で指定します。
@raise IOError 自身が書き込み可能でない時に発生します。
@raise Errno::EINVAL len がマイナスの時に発生します。
//emlist[例][ruby]{
require "stringio"
a = StringIO.new("hoge", 'r+')
a.truncate(2)......a.string #=> "ho"
a.truncate(5)
a.string #=> "ho\000\000\000"
//}... -
Pathname
# relative _ path _ from(base _ directory) -> Pathname (9119.0) -
base_directory から self への相対パスを求め、その内容の新しい Pathname オブジェクトを生成して返します。
...e_directory から self への相対パスを求め、その内容の新しい Pathname
オブジェクトを生成して返します。
パス名の解決は文字列操作によって行われ、ファイルシステムをアクセス
しません。
self が相対パスなら base_directory も......絶対パスなら
base_directory も絶対パスでなければなりません。
@param base_directory ベースディレクトリを表す Pathname オブジェクトを指定します。
@raise ArgumentError Windows上でドライブが違うなど、base_directory から self への相対パ......スが求められないときに例外が発生します。
//emlist[例][ruby]{
require 'pathname'
path = Pathname.new("/tmp/foo")
base = Pathname.new("/tmp")
path.relative_path_from(base) # => #<Pathname:foo>
//}... -
Rake
:: TaskManager # synthesize _ file _ task(task _ name) -> Rake :: FileTask | nil (9119.0) -
与えられたタスク名をもとにファイルタスクを合成します。
...合成します。
@param task_name タスク名を指定します。
@return 与えられたタスク名と同名のファイルが存在する場合は、ファイルタスクを作成して返します。
そうでない場合は nil を返します。
@raise RuntimeError タスクを......。
//emlist[][ruby]{
# Rakefile での記載例とする
task default: :test_rake_app
task :test_rake_app do |task|
task.application.synthesize_file_task("sample_file") # => nil
IO.write("sample_file", "")
task.application.synthesize_file_task("sample_file") # => <Rake::FileTask sample_fil... -
String
# byteindex(pattern , offset = 0) -> Integer | nil (6325.0) -
文字列の offset から右に向かって pattern を検索し、 最初に見つかった部分文字列の左端のバイト単位のインデックスを返します。 見つからなければ nil を返します。
...文字列の offset から右に向かって pattern を検索し、
最初に見つかった部分文字列の左端のバイト単位のインデックスを返します。
見つからなければ nil を返します。
引数 pattern は探索する部分文字列または正規表現で指定......します。
offset が負の場合、文字列の末尾から数えた位置から探索します。
@param pattern 探索する部分文字列または正規表現
@param offset 探索を開始するバイト単位のオフセット
@raise IndexError オフセットが文字列の境界......emlist[例][ruby]{
'foo'.byteindex('f') # => 0
'foo'.byteindex('o') # => 1
'foo'.byteindex('oo') # => 1
'foo'.byteindex('ooo') # => nil
'foo'.byteindex(/f/) # => 0
'foo'.byteindex(/o/) # => 1
'foo'.byteindex(/oo/) # => 1
'foo'.byteindex(/ooo/) # => nil
'foo'.byteindex('o', 1) # => 1
'foo'.byteinde...