Class: Nokogiri::XML::Node

Inherits:
Object
  • Object
show all
Defined in:
lib/matcher/nokogiri_extensions.rb

Instance Method Summary collapse

Instance Method Details

#match?(other, matcher) ⇒ Boolean

Returns:

  • (Boolean)


9
10
11
# File 'lib/matcher/nokogiri_extensions.rb', line 9

def match?(other, matcher)
  matching(other, matcher) ? true : false
end

#matching(other, matcher) ⇒ Object



13
14
15
16
17
# File 'lib/matcher/nokogiri_extensions.rb', line 13

def matching(other, matcher)
  other_elem = other.at_xpath(path)
  matcher.record(self.path, false, Matcher::Xml::EXISTENCE, Matcher::Xml::NOT_FOUND) unless other_elem
  other_elem
end