class Sexp::Not
Matches when sub-expression does not match.
This is also available via Matcher#-@
.
examples:
s(:a) / s{ not?(s(:b)) } #=> [s(:a)] s(:a) / s{ -s(:b) } #=> [s(:a)] s(:a) / s{ s(not? :a) } #=> []
Attributes
The value to negate in the match.
Public Class Methods
Source
# File lib/sexp_matcher.rb, line 707 def initialize value @value = value end
Creates a Matcher
which will match any Sexp that does not match the value
Public Instance Methods
Source
# File lib/sexp_matcher.rb, line 718 def satisfy? o !(value.kind_of?(Sexp) ? value.satisfy?(o) : value == o) end
Satisfied if a o
does not match the value