種類
- 特異メソッド (296)
- インスタンスメソッド (258)
- モジュール関数 (120)
- クラス (72)
- オブジェクト (12)
ライブラリ
- ビルトイン (758)
クラス
- Bignum (3)
- Data (6)
- Dir (24)
- Exception (32)
- Integer (12)
- Module (36)
- NameError (24)
- NoMethodError (12)
- Numeric (12)
- Object (12)
- Proc (14)
-
RubyVM
:: InstructionSequence (72) - Struct (48)
- Thread (78)
-
Thread
:: Backtrace :: Location (36) - TracePoint (7)
モジュール
- Kernel (120)
オブジェクト
- main (126)
キーワード
- DomainError (12)
- Enumerator (12)
- Fiber (12)
- FloatDomainError (12)
- Location (12)
- NameError (12)
- [] (20)
- abort (12)
- args (12)
-
at
_ exit (12) - autoload (12)
-
backtrace
_ locations (36) -
base
_ label (24) - caller (36)
-
caller
_ locations (24) -
compile
_ file (12) - define (6)
-
define
_ method (24) - disasm (12)
- disassemble (12)
- gets (12)
- glob (16)
- include (12)
- inspect (24)
-
instruction
_ sequence (7) - label (12)
- name (12)
- new (50)
- pass (12)
- private (27)
- public (27)
- raise (12)
- readline (12)
- readlines (12)
- refine (12)
- remainder (27)
-
report
_ on _ exception (9) -
report
_ on _ exception= (9) -
respond
_ to? (12) -
set
_ backtrace (12) -
to
_ a (12) -
to
_ s (36) - using (24)
検索結果
先頭5件
-
Math
:: DomainError (14000.0) -
数学関数(module Math のモジュール関数)で与えた引数が定義域 に含まれていない場合に発生します。
数学関数(module Math のモジュール関数)で与えた引数が定義域
に含まれていない場合に発生します。 -
Thread
. pass -> nil (8024.0) -
他のスレッドに実行権を譲ります。実行中のスレッドの状態を変えずに、 他の実行可能状態のスレッドに制御を移します。
...権を譲ります。実行中のスレッドの状態を変えずに、
他の実行可能状態のスレッドに制御を移します。
Thread.new do
(1..3).each{|i|
p i
Thread.pass
}
exit
end
loop do
Thread.pass
p :main
end
#=>
1
:main
2
:main
3
:main... -
Exception
# full _ message(highlight: true , order: :bottom) -> String (8018.0) -
例外の整形された文字列を返します。
...st):\ntest.rb:2:in `<main>': \e[1mtest (\e[4;1mRuntimeError\e[m\e[1m)\n\e[m"
$stderr = $stdout
p e.full_message # => "test.rb:2:in `<main>': test (RuntimeError)\n"
$stderr = STDERR
p e.full_message # => "\e[1mTraceback \e[m(most recent call last):\ntest.rb:2:in `<main>': \e[1mtest (\e[4;... -
Kernel
. # caller(range) -> [String] | nil (8018.0) -
start 段上の呼び出し元の情報を $@ の形式のバックトレース(文字列の配列)として返します。
...aller(2)
p caller(3)
p caller(4)
end
def bar
foo
end
bar
#=> ["-:2:in `foo'", "-:10:in `bar'", "-:13:in `<main>'"]
# ["-:10:in `bar'", "-:13:in `<main>'"]
# ["-:13:in `<main>'"]
# []
# nil
//}
以下の関数は、caller の要素から [ファイル名, 行番号, メソッド名]... -
Kernel
. # caller(start = 1) -> [String] | nil (8018.0) -
start 段上の呼び出し元の情報を $@ の形式のバックトレース(文字列の配列)として返します。
...aller(2)
p caller(3)
p caller(4)
end
def bar
foo
end
bar
#=> ["-:2:in `foo'", "-:10:in `bar'", "-:13:in `<main>'"]
# ["-:10:in `bar'", "-:13:in `<main>'"]
# ["-:13:in `<main>'"]
# []
# nil
//}
以下の関数は、caller の要素から [ファイル名, 行番号, メソッド名]... -
Kernel
. # caller(start , length) -> [String] | nil (8018.0) -
start 段上の呼び出し元の情報を $@ の形式のバックトレース(文字列の配列)として返します。
...aller(2)
p caller(3)
p caller(4)
end
def bar
foo
end
bar
#=> ["-:2:in `foo'", "-:10:in `bar'", "-:13:in `<main>'"]
# ["-:10:in `bar'", "-:13:in `<main>'"]
# ["-:13:in `<main>'"]
# []
# nil
//}
以下の関数は、caller の要素から [ファイル名, 行番号, メソッド名]... -
Exception
# backtrace _ locations -> [Thread :: Backtrace :: Location] (8012.0) -
バックトレース情報を返します。Exception#backtraceに似ていますが、 Thread::Backtrace::Location の配列を返す点が異なります。
...et_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_exception'", "test.rb:15:in `<main>'"]
//}
@see Exception#backtrace... -
Exception
# set _ backtrace(errinfo) -> nil | String | [String] (8012.0) -
バックトレース情報に errinfo を設定し、設定されたバックトレース 情報を返します。
...定します。
//emlist[例][ruby]{
begin
begin
raise "inner"
rescue
raise "outer"
end
rescue
$!.backtrace # => ["/path/to/test.rb:5:in `rescue in <main>'", "/path/to/test.rb:2:in `<main>'"]
$!.set_backtrace(["dummy1", "dummy2"])
$!.backtrace # => ["dummy1", "dummy2"]
end
//}... -
Kernel
. # at _ exit { . . . } -> Proc (8012.0) -
与えられたブロックをインタプリタ終了時に実行します。
...Proc オブジェクトで返します。
//emlist[例][ruby]{
3.times do |i|
at_exit{puts "at_exit#{i}"}
end
END{puts "END"}
at_exit{puts "at_exit"}
puts "main_end"
#=> main_end
# at_exit
# END
# at_exit2
# at_exit1
# at_exit0
//}
@see d:spec/control#END,Kernel.#exit!,Kernel.#fork... -
Module
# refine(klass) { . . . } -> Module (8012.0) -
引数 klass で指定したクラスまたはモジュールだけに対して、ブロックで指定した機能を提供で きるモジュールを定義します。定義した機能は Module#refine を使用せずに直 接 klass に対して変更を行う場合と異なり、限られた範囲のみ有効にできます。 そのため、既存の機能を局所的に修正したい場合などに用いる事ができます。
...ubyist.net/articles/0041/0041-200Special-refinement.html
* https://docs.ruby-lang.org/en/master/syntax/refinements_rdoc.html
定義した機能は main.using, Module#using を実行した場合のみ
有効になります。
@param klass 拡張する対象のクラスまたはモジュールを......機能を持つ無名のモジュールを返します。
//emlist[例][ruby]{
class C
def foo
puts "C#foo"
end
end
module M
refine C do
def foo
puts "C#foo in M"
end
end
end
x = C.new
x.foo # => "C#foo"
using M
x = C.new
x.foo # => "C#foo in M"
//}
@see main.using...