Ruby 2.6.0 リファレンスマニュアル > ライブラリ一覧 > e2mmapライブラリ > Exception2MessageMapperモジュール > def_exception

instance method Exception2MessageMapper#def_exception

def_exception(exception_name, message_format, superclass = StandardError) -> Class[permalink][rdoc]

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

[PARAM] exception_name:
定義する例外クラスの名前をシンボルで指定します。
[PARAM] message_format:
メッセージのフォーマット。
[PARAM] superclass:
定義する例外のスーパークラスを指定します。省略すると StandardError を使用します。