class Nokogiri::XML::DocumentFragment
def search(*rules)
Search this fragment for +paths+. +paths+ must be one or more XPath or CSS queries.
call-seq: search *paths, [namespace-bindings, xpath-variable-bindings, custom-handler-class]
##
def search(*rules) rules, handler, ns, binds = extract_params(rules) rules.inject(NodeSet.new(document)) do |set, rule| set + if Searchable::LOOKS_LIKE_XPATH.match?(rule) xpath(*[rule, ns, handler, binds].compact) else children.css(*[rule, ns, handler].compact) # 'children' is a smell here end end end