class SexpPath::Matcher::Not

See SexpQueryBuilder.not

Attributes

value[R]

Public Class Methods

new(value) click to toggle source

Creates a Matcher which will match any Sexp that does not match the value

# File lib/sexp_path/matcher/not.rb, line 6
def initialize(value)
  @value = value
end

Public Instance Methods

inspect() click to toggle source
# File lib/sexp_path/matcher/not.rb, line 17
def inspect
  "is_not(#{value.inspect})"
end
satisfy?(o, data={}) click to toggle source

Satisfied if a o does not match the value

# 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