Class: Adyen::API::XMLQuerier::REXMLBackend

Inherits:
Object
  • Object
show all
Defined in:
lib/adyen/api/xml_querier.rb

Instance Method Summary collapse

Constructor Details

#initializeREXMLBackend

Returns a new instance of REXMLBackend.



41
42
43
# File 'lib/adyen/api/xml_querier.rb', line 41

def initialize
  require 'rexml/document'
end

Instance Method Details

#document_for_html(html) ⇒ Object



45
46
47
# File 'lib/adyen/api/xml_querier.rb', line 45

def document_for_html(html)
  REXML::Document.new(html)
end

#document_for_xml(xml) ⇒ Object



49
50
51
# File 'lib/adyen/api/xml_querier.rb', line 49

def document_for_xml(xml)
  REXML::Document.new(xml)
end

#perform_xpath(query, root_node) ⇒ Object



53
54
55
# File 'lib/adyen/api/xml_querier.rb', line 53

def perform_xpath(query, root_node)
  REXML::XPath.match(root_node, query, NS)          
end

#stringify_nodeset(nodeset) ⇒ Object



57
58
59
# File 'lib/adyen/api/xml_querier.rb', line 57

def stringify_nodeset(nodeset)
  nodeset.map { |n| n.to_s }.join("")
end