種類
- インスタンスメソッド (11)
- 特異メソッド (5)
ライブラリ
- ビルトイン (9)
-
json
/ add / core (2) -
syck
/ rubytypes (5)
キーワード
- == (1)
- backtrace (1)
- exception (3)
-
json
_ create (1) - new (1)
-
set
_ backtrace (1) - taguri (1)
- taguri= (1)
-
to
_ json (1) -
to
_ s (1) -
to
_ yaml (1) -
yaml
_ new (1) -
yaml
_ tag _ subclasses? (1)
検索結果
先頭5件
-
Exception
# ==(other) -> bool (2) -
自身と指定された other のクラスが同じであり、message と backtrace が == メソッドで比較して 等しい場合に true を返します。そうでない場合に false を返します。
自身と指定された other のクラスが同じであり、message と backtrace が == メソッドで比較して
等しい場合に true を返します。そうでない場合に false を返します。
@param other 自身と比較したいオブジェクトを指定します。 -
Exception
# backtrace -> [String] (2) -
バックトレース情報を返します。
バックトレース情報を返します。
デフォルトでは
* "#{sourcefile}:#{sourceline}:in `#{method}'"
(メソッド内の場合)
* "#{sourcefile}:#{sourceline}"
(トップレベルの場合)
という形式の String の配列です。
def methd
raise
end
begin
methd
rescue => e
p e.backtrace
end
#=> ["filename.rb:2:in `methd'", "filename.rb:6"] -
Exception
# exception -> self (2) -
引数を指定しない場合は self を返します。引数を指定した場合 自身のコピー を生成し Exception#message 属性を error_message にして返します。
...lf を返します。引数を指定した場合 自身のコピー
を生成し Exception#message 属性を error_message にして返します。
Kernel.#raise は、実質的に、例外オブジェクトの exception
メソッドの呼び出しです。
@param error_message エラーメッセ......ージを表す文字列を指定します。
begin
... # 何か処理
rescue => e
raise e.exception("an error occurs during hogehoge process") # 詳しいエラーメッセージ
end... -
Exception
# exception(error _ message) -> Exception (2) -
引数を指定しない場合は self を返します。引数を指定した場合 自身のコピー を生成し Exception#message 属性を error_message にして返します。
...lf を返します。引数を指定した場合 自身のコピー
を生成し Exception#message 属性を error_message にして返します。
Kernel.#raise は、実質的に、例外オブジェクトの exception
メソッドの呼び出しです。
@param error_message エラーメッセ......ージを表す文字列を指定します。
begin
... # 何か処理
rescue => e
raise e.exception("an error occurs during hogehoge process") # 詳しいエラーメッセージ
end... -
Exception
# message -> String (2) -
エラーメッセージをあらわす文字列を返します。
エラーメッセージをあらわす文字列を返します。
begin
1 + nil
rescue => e
p e.message #=> "nil can't be coerced into Fixnum"
end -
Exception
# set _ backtrace(errinfo) -> nil | String | [String] (2) -
バックトレース情報に errinfo を設定し、設定されたバックトレース 情報を返します。
バックトレース情報に errinfo を設定し、設定されたバックトレース
情報を返します。
@param errinfo nil、String あるいは String の配列のいずれかを指定します。 -
Exception
# taguri -> String (2) -
自身のタグ URI を返します。
自身のタグ URI を返します。 -
Exception
# taguri=(val) (2) -
自身のタグ URI を val に設定します。
自身のタグ URI を val に設定します。
@param val タグ URI を文字列で指定します。 -
Exception
# to _ json(*args) -> String (2) -
自身を JSON 形式の文字列に変換して返します。
自身を JSON 形式の文字列に変換して返します。
内部的にはハッシュにデータをセットしてから Hash#to_json を呼び出しています。
@param args 引数はそのまま Hash#to_json に渡されます。
@see Hash#to_json -
Exception
# to _ s -> String (2) -
エラーメッセージをあらわす文字列を返します。
エラーメッセージをあらわす文字列を返します。
begin
1 + nil
rescue => e
p e.message #=> "nil can't be coerced into Fixnum"
end -
Exception
# to _ yaml(opts = {}) (2) -
自身を YAML ドキュメントに変換します。
自身を YAML ドキュメントに変換します。
@param opts YAML ドキュメント出力の際のオプションを指定します。
オプションの詳細は Syck::Emitter#reset を参照し
てください。 -
Exception
. exception(error _ message = nil) (2) -
例外オブジェクトを生成して返します。
...す。
@param error_message エラーメッセージを表す文字列を指定します。このメッセージは
属性 Exception#message の値になり、デフォルトの例外ハンドラで表示されます。... -
Exception
. json _ create(hash) -> Exception (2) -
JSON のオブジェクトから Ruby のオブジェクトを生成して返します。
JSON のオブジェクトから Ruby のオブジェクトを生成して返します。
@param hash 適切なキーを持つハッシュを指定します。 -
Exception
. new(error _ message = nil) (2) -
例外オブジェクトを生成して返します。
...す。
@param error_message エラーメッセージを表す文字列を指定します。このメッセージは
属性 Exception#message の値になり、デフォルトの例外ハンドラで表示されます。... -
Exception
. yaml _ new(klass , tag , val) (2) -
ライブラリ内部で使用します。
ライブラリ内部で使用します。 -
Exception
. yaml _ tag _ subclasses? -> true (2) -
常に true を返します。
常に true を返します。
ライブラリ内部で使用します。
