るりまサーチ

最速Rubyリファレンスマニュアル検索!
18件ヒット [1-18件を表示] (0.019秒)

別のキーワード

  1. open3 popen2e
  2. socket af_e164
  3. open3 capture2e
  4. matrix det_e
  5. matrix rank_e

ライブラリ

モジュール

検索結果

e2mmap (38018.0)

例外クラスに特定のエラーメッセージ用フォーマットを関連づけるためのライブラリです。

...o
extend Exception2MessageMapper
def_e2message ExistingExceptionClass, "message..."
def_exception :NewExceptionClass, "message...", StandardError
...
end

foo = Foo.new
foo.Fail ....

2. 何度も使いたい例外クラスは、クラスの代わりにモジュールで定...
...d
extend Exception2MessageMapper
def_e2message ExistingExceptionClass, "message..."
def_exception :NewExceptionClass, "message...", StandardError
...
end
class Foo
include ErrorMod
...
end

foo = Foo.new
foo.Fail ....

3. 例外を設定したクラスのインス...
...d
extend Exception2MessageMapper
def_e2message ExistingExceptionClass, "message..."
def_exception :NewExceptionClass, "message...", StandardError
...
end
class Foo
extend Exception2MessageMapper
include ErrorMod
...
end

Foo.Fail NewExceptionClass, arg...
Foo....

Exception2MessageMapper#def_exception(exception_name, message_format, superclass = StandardError) -> Class (8107.0)

exception_name という名前の例外クラスを定義します。

...ion_name 定義する例外クラスの名前をシンボルで指定します。

@param message_format メッセージのフォーマット。

@param superclass 定義する例外のスーパークラスを指定します。
省略すると StandardError を使用します。...

Exception2MessageMapper.def_exception(klass, exception_name, message_format, superklass = StandardError) -> Class (8107.0)

exception_name という名前の例外クラスを定義します。

...el.#sprintf のフォーマット文字列と同じ形式を使用できます。

@param superklass 定義する例外クラスのスーパークラスを指定します。
省略すると StandardError を使用します。

@return 定義した例外クラスを返します。...