Method: Constrain::MatchError#initialize
- Defined in:
- lib/constrain.rb
#initialize(value, exprs, message: nil, unwind: 0, not_argument: false, not_value: nil) ⇒ MatchError
Returns a new instance of MatchError.
6 7 8 9 10 11 12 |
# File 'lib/constrain.rb', line 6 def initialize(value, exprs, message: nil, unwind: 0, not_argument: false, not_value: nil) if not_argument super || "Expected #{value.inspect} to not equal #{not_value.inspect}" else super || "Expected #{value.inspect} to match #{Constrain.fmt_exprs(exprs)}" end end |