Exception: HatiConfig::SettingTypeError
- Inherits:
-
TypeError
- Object
- TypeError
- HatiConfig::SettingTypeError
- Defined in:
- lib/hati_config/errors.rb
Overview
Custom error raised when a setting type does not match the expected type.
Instance Method Summary collapse
-
#initialize(type, val) ⇒ SettingTypeError
constructor
Initializes a new SettingTypeError.
-
#type_error_msg(type, val) ⇒ String
Generates the error message for the exception.
Constructor Details
#initialize(type, val) ⇒ SettingTypeError
Initializes a new SettingTypeError.
16 17 18 |
# File 'lib/hati_config/errors.rb', line 16 def initialize(type, val) super(type_error_msg(type, val)) end |
Instance Method Details
#type_error_msg(type, val) ⇒ String
Generates the error message for the exception.
25 26 27 |
# File 'lib/hati_config/errors.rb', line 25 def type_error_msg(type, val) "Expected: <#{type}>. Given: #{val.inspect} which is <#{val.class}> class." end |