Class: SexpPath::Matcher::Atom

Inherits:
Base
  • Object
show all
Defined in:
lib/sexp_path/matcher/atom.rb

Overview

See SexpQueryBuilder.atom

Instance Method Summary collapse

Methods inherited from Base

#&, #-@, #>>, #|

Methods included from Traverse

#capture_as, #replace_sexp, #search, #search_each

Instance Method Details

#inspectObject

Prints as atom



11
12
13
# File 'lib/sexp_path/matcher/atom.rb', line 11

def inspect
  "atom"
end

#satisfy?(o, data = {}) ⇒ Boolean

Satisfied when o is an atom (anything that is not an S-Expression)

Returns:

  • (Boolean)


4
5
6
7
8
# File 'lib/sexp_path/matcher/atom.rb', line 4

def satisfy?(o, data={})
  return nil if o.is_a? Sexp

  capture_match o, data
end