Method: Nokogiri::XML::Node#content!
- Defined in:
- lib/ryoba/nokogiri/xml/node.rb
#content! ⇒ String Also known as: inner_text!, text!
Equivalent to .content.strip
, but raises an error if the result is an empty string.
52 53 54 55 56 57 58 |
# File 'lib/ryoba/nokogiri/xml/node.rb', line 52 def content! result = self.content.strip if result.empty? raise Ryoba::Error.new("No text in:\n#{self.to_html}") end result end |