Class: Adyen::API::XMLQuerier::NokogiriBackend
- Inherits:
-
Object
- Object
- Adyen::API::XMLQuerier::NokogiriBackend
- Defined in:
- lib/adyen/api/xml_querier.rb
Instance Method Summary collapse
- #document_for_html(html) ⇒ Object
- #document_for_xml(xml) ⇒ Object
-
#initialize ⇒ NokogiriBackend
constructor
A new instance of NokogiriBackend.
- #perform_xpath(query, root_node) ⇒ Object
- #stringify_nodeset(nodeset) ⇒ Object
Constructor Details
#initialize ⇒ NokogiriBackend
Returns a new instance of NokogiriBackend.
19 20 21 |
# File 'lib/adyen/api/xml_querier.rb', line 19 def initialize require 'nokogiri' end |
Instance Method Details
#document_for_html(html) ⇒ Object
23 24 25 |
# File 'lib/adyen/api/xml_querier.rb', line 23 def document_for_html(html) Nokogiri::HTML::Document.parse(html, nil, 'UTF-8') end |
#document_for_xml(xml) ⇒ Object
27 28 29 |
# File 'lib/adyen/api/xml_querier.rb', line 27 def document_for_xml(xml) Nokogiri::XML::Document.parse(xml) end |
#perform_xpath(query, root_node) ⇒ Object
31 32 33 |
# File 'lib/adyen/api/xml_querier.rb', line 31 def perform_xpath(query, root_node) root_node.xpath(query, NS) end |
#stringify_nodeset(nodeset) ⇒ Object
35 36 37 |
# File 'lib/adyen/api/xml_querier.rb', line 35 def stringify_nodeset(nodeset) nodeset.to_xml(encoding: 'UTF-8') end |