Class: SexpPath::Matcher::Not
- Defined in:
- lib/sexp_path/matcher/not.rb
Overview
See SexpQueryBuilder.not
Instance Attribute Summary collapse
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(value) ⇒ Not
constructor
Creates a Matcher which will match any Sexp that does not match the
value
. - #inspect ⇒ Object
-
#satisfy?(o, data = {}) ⇒ Boolean
Satisfied if a
o
does not match thevalue
.
Methods inherited from Base
Methods included from Traverse
#capture_as, #replace_sexp, #search, #search_each
Constructor Details
#initialize(value) ⇒ Not
Creates a Matcher which will match any Sexp that does not match the value
6 7 8 |
# File 'lib/sexp_path/matcher/not.rb', line 6 def initialize(value) @value = value end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
3 4 5 |
# File 'lib/sexp_path/matcher/not.rb', line 3 def value @value end |
Instance Method Details
#inspect ⇒ Object
17 18 19 |
# File 'lib/sexp_path/matcher/not.rb', line 17 def inspect "is_not(#{value.inspect})" end |
#satisfy?(o, data = {}) ⇒ Boolean
Satisfied if a o
does not match the value
11 12 13 14 15 |
# File 'lib/sexp_path/matcher/not.rb', line 11 def satisfy?(o, data={}) return nil if value.is_a?(Sexp) ? value.satisfy?(o, data) : value == o capture_match o, {} end |