267件ヒット
[1-100件を表示]
(0.074秒)
ライブラリ
- ビルトイン (159)
-
irb
/ context (12) -
json
/ add / exception (12) - mkmf (24)
-
net
/ smtp (24) -
rake
/ rdoctask (12)
クラス
- Exception (44)
-
IRB
:: Context (12) - Module (12)
-
Net
:: SMTP (24) - Object (12)
-
RDoc
:: Options (24) -
Rake
:: RDocTask (12) -
RubyVM
:: InstructionSequence (36) - Thread (24)
-
Thread
:: Backtrace :: Location (36) - TracePoint (7)
モジュール
- Kernel (24)
キーワード
- autoload (12)
-
backtrace
_ locations (36) -
base
_ label (24) - ehlo (12)
- helo (12)
- inspect (12)
-
instruction
_ sequence (7) - label (12)
-
main
_ page (12) -
main
_ page= (12) -
respond
_ to? (12) -
set
_ backtrace (12) -
to
_ a (12) -
to
_ json (12) -
to
_ s (12) -
try
_ link (24)
検索結果
先頭5件
-
IRB
:: Context # main -> object (21102.0) -
self に設定されたオブジェクトを返します。
self に設定されたオブジェクトを返します。
@see cwws コマンド -
Exception
# backtrace _ locations -> [Thread :: Backtrace :: Location] (9213.0) -
バックトレース情報を返します。Exception#backtraceに似ていますが、 Thread::Backtrace::Location の配列を返す点が異なります。
...。Exception#backtraceに似ていますが、
Thread::Backtrace::Location の配列を返す点が異なります。
現状では Exception#set_backtrace によって戻り値が変化する事はあり
ません。
//emlist[例: test.rb][ruby]{
require "date"
def check_long_month(month)
return......te.new(2000, 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_exception'", "test.rb:15:in `<main>'"]
//}
@see Exception#backtrace... -
RDoc
:: Options # main _ page -> String | nil (9118.0) -
コマンドライン引数の --main オプションで指定したファイル名、クラス/モ ジュール名を返します。
...コマンドライン引数の --main オプションで指定したファイル名、クラス/モ
ジュール名を返します。
指定しなかった場合は nil を返します。... -
RDoc
:: Options # main _ page=(val) (9118.0) -
コマンドライン引数の --main オプションと同様の指定を行います。
...コマンドライン引数の --main オプションと同様の指定を行います。
@param val 設定するファイル名、クラス/モジュール名を文字列で指定します。... -
Exception
# to _ json(*args) -> String (9107.0) -
自身を JSON 形式の文字列に変換して返します。
...身を JSON 形式の文字列に変換して返します。
内部的にはハッシュにデータをセットしてから JSON::Generator::GeneratorMethods::Hash#to_json を呼び出しています。
@param args 引数はそのまま JSON::Generator::GeneratorMethods::Hash#to_json に渡され......ます。
//emlist[例][ruby]{
require "json/add/core"
begin
0/0
rescue => e
e.to_json # => "{\"json_class\":\"ZeroDivisionError\",\"m\":\"divided by 0\",\"b\":[\"/path/to/test.rb:4:in `/'\",\"/path/to/test.rb:4:in `<main>'\"]}"
end
//}
@see JSON::Generator::GeneratorMethods::Hash#to_json... -
Thread
# backtrace _ locations(range) -> [Thread :: Backtrace :: Location] | nil (6207.0) -
スレッドの現在のバックトレースを Thread::Backtrace::Location の配 列で返します。
...スレッドの現在のバックトレースを Thread::Backtrace::Location の配
列で返します。
引数で指定した値が範囲外の場合、スレッドがすでに終了している場合は nil
を返します。
@param start 開始フレームの位置を数値で指定します......rnel.#caller_locations と似ていますが、本メソッドは self に限定
した情報を返します。
//emlist[例][ruby]{
thread = Thread.new { sleep 1 }
thread.run
thread.backtrace_locations # => ["/path/to/test.rb:1:in `sleep'", "/path/to/test.rb:1:in `block in <main>'"]
//}
@see Thre......ad::Backtrace::Location... -
Thread
# backtrace _ locations(start = 0 , length = nil) -> [Thread :: Backtrace :: Location] | nil (6207.0) -
スレッドの現在のバックトレースを Thread::Backtrace::Location の配 列で返します。
...スレッドの現在のバックトレースを Thread::Backtrace::Location の配
列で返します。
引数で指定した値が範囲外の場合、スレッドがすでに終了している場合は nil
を返します。
@param start 開始フレームの位置を数値で指定します......rnel.#caller_locations と似ていますが、本メソッドは self に限定
した情報を返します。
//emlist[例][ruby]{
thread = Thread.new { sleep 1 }
thread.run
thread.backtrace_locations # => ["/path/to/test.rb:1:in `sleep'", "/path/to/test.rb:1:in `block in <main>'"]
//}
@see Thre......ad::Backtrace::Location... -
TracePoint
# instruction _ sequence -> RubyVM :: InstructionSequence (6207.0) -
script_compiledイベント発生時にコンパイルされた RubyVM::InstructionSequenceインスタンスを返します。
...ト発生時にコンパイルされた
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("puts 'hello'")
end
//}... -
Object
# respond _ to?(name , include _ all = false) -> bool (6107.0) -
オブジェクトがメソッド name を持つとき真を返します。
...メソッドで NotImplementedError が発生する場合は true を返します。
メソッドが定義されていない場合は、Object#respond_to_missing? を呼
び出してその結果を返します。
@param name Symbol または文字列で指定するメソッド名です。
@param......Bonjour"
end
end
class D
private
def hello
"Guten Tag"
end
end
list = [F.new,D.new]
list.each{|it| puts it.hello if it.respond_to?(:hello)}
#=> Bonjour
list.each{|it| it.instance_eval("puts hello if it.respond_to?(:hello, true)")}
#=> Bonjour
# Guten Tag
module Template
def main......espond_to?(:template_method) # => true
# NotImplementedError が発生しているが、Rubyによる実装部のため true を返す
puts NotImplTemplateMethod.new.respond_to?(:template_method) # => true
# GNU/Linux で実行。C言語による実装部のため false を返す
puts File.respond_t...