Exception: Constrain::MatchError
- Inherits:
-
StandardError
- Object
- StandardError
- Constrain::MatchError
- Defined in:
- lib/constrain.rb
Overview
Raised if types doesn’t match a class expression
Instance Method Summary collapse
-
#initialize(value, exprs, message: nil, unwind: 0) ⇒ MatchError
constructor
A new instance of MatchError.
Constructor Details
#initialize(value, exprs, message: nil, unwind: 0) ⇒ MatchError
Returns a new instance of MatchError.
6 7 8 |
# File 'lib/constrain.rb', line 6 def initialize(value, exprs, message: nil, unwind: 0) super || "Expected #{value.inspect} to match #{Constrain.fmt_exprs(exprs)}" end |