Exception: Plurimath::Math::InvalidTypeError
- Inherits:
-
TypeError
- Object
- TypeError
- Plurimath::Math::InvalidTypeError
- Defined in:
- lib/plurimath/errors/invalid_type_error.rb
Instance Method Summary collapse
- #formula_message(type) ⇒ Object
-
#initialize(type = nil) ⇒ InvalidTypeError
constructor
A new instance of InvalidTypeError.
- #parse_message ⇒ Object
Constructor Details
#initialize(type = nil) ⇒ InvalidTypeError
Returns a new instance of InvalidTypeError.
6 7 8 |
# File 'lib/plurimath/errors/invalid_type_error.rb', line 6 def initialize(type = nil) super(type ? (type) : ) end |
Instance Method Details
#formula_message(type) ⇒ Object
14 15 16 |
# File 'lib/plurimath/errors/invalid_type_error.rb', line 14 def (type) "Invalid type provided: #{type}. Must be one of #{Formula::MATH_ZONE_TYPES.join(', ')}." end |
#parse_message ⇒ Object
10 11 12 |
# File 'lib/plurimath/errors/invalid_type_error.rb', line 10 def "`type` must be one of: `#{Math::VALID_TYPES.keys.join('`, `')}`" end |