Method: Nokogiri::XML::Searchable#ancestor
- Defined in:
- lib/ryoba/nokogiri/xml/searchable.rb
#ancestor(selector = nil) ⇒ Nokogiri::XML::Element?
Like Searchable#ancestors, but returns only the first matching ancestor.
104 105 106 |
# File 'lib/ryoba/nokogiri/xml/searchable.rb', line 104 def ancestor(selector = nil) self.ancestors(selector).first end |