Method: Nokogiri::XML::Searchable#at!
- Defined in:
- lib/ryoba/nokogiri/xml/searchable.rb
#at!(*queries) ⇒ Nokogiri::XML::Element
Like Searchable#at, but raises an error if there are no results.
46 47 48 49 50 51 52 |
# File 'lib/ryoba/nokogiri/xml/searchable.rb', line 46 def at!(*queries) result = self.at(*queries) if result.nil? raise Ryoba::Error.new("No elements matching #{queries.map(&:inspect).join(" OR ")}") end result end |