Module: Doodle::XML::NokogiriAdapter
- Included in:
- Doodle::XML
- Defined in:
- lib/doodle/xml.rb
Overview
adapter module for Nokogiri
Instance Method Summary collapse
-
#get_root(doc) ⇒ Object
get the first XML element in the document.
-
#parse_xml(xml) ⇒ Object
return the parsed xml DOM.
-
#text_node?(node) ⇒ Boolean
test whether a node is a text node.
Instance Method Details
#get_root(doc) ⇒ Object
get the first XML element in the document
74 75 76 |
# File 'lib/doodle/xml.rb', line 74 def get_root(doc) doc.children.first end |
#parse_xml(xml) ⇒ Object
return the parsed xml DOM
64 65 66 |
# File 'lib/doodle/xml.rb', line 64 def parse_xml(xml) Nokogiri::XML(xml) end |
#text_node?(node) ⇒ Boolean
test whether a node is a text node
69 70 71 |
# File 'lib/doodle/xml.rb', line 69 def text_node?(node) node.name == "text" end |