class Sexp::MatchCollection

Wraps the results of a Sexp query. MatchCollection defines MatchCollection#/ so that you can chain queries.

For instance:

res = s(:a, s(:b)) / s{ s(:a,_) } / s{ s(:b) }

Public Instance Methods

/(pattern) click to toggle source

See Traverse#search

# File lib/sexp.rb, line 1394
def / pattern
  inject(self.class.new) { |result, match|
    result.concat match / pattern
  }
end