102件ヒット
[101-102件を表示]
(0.015秒)
別のキーワード
種類
- 特異メソッド (42)
- インスタンスメソッド (36)
- モジュール (12)
- ライブラリ (6)
- クラス (6)
ライブラリ
- e2mmap (96)
モジュール
キーワード
- E2MM (6)
- ErrNotRegisteredException (6)
- Fail (12)
- Raise (12)
- bind (6)
-
def
_ exception (12) - e2mmap (6)
-
extend
_ object (6) - fail (6)
検索結果
先頭1件
-
e2mmap (84.0)
-
例外クラスに特定のエラーメッセージ用フォーマットを関連づけるためのライブラリです。
...Exception2MessageMapper を extend すれば、
def_e2message メソッドや def_exception メソッドが使えます。
これらで例外クラスとメッセージを関連づけることができます。
例:
class Foo
extend Exception2MessageMapper
def_e2message ExistingException......f_exception :NewExceptionClass, "message...", StandardError
...
end
foo = Foo.new
foo.Fail ....
2. 何度も使いたい例外クラスは、クラスの代わりにモジュールで定義して、
それを include して使います。
例:
module ErrorMod
extend Exception2M......essageMapper
def_e2message ExistingExceptionClass, "message..."
def_exception :NewExceptionClass, "message...", StandardError
...
end
class Foo
include ErrorMod
...
end
foo = Foo.new
foo.Fail ....
3. 例外を設定したクラスのインスタンス以外から例...