class Placemaker::XmlParser
Public Class Methods
new(xml_body)
click to toggle source
# File lib/placemaker/xml_parser.rb 5 def initialize(xml_body) 6 @xml = Nokogiri::XML(xml_body) 7 end
Public Instance Methods
document_length()
click to toggle source
length in bytes of the document
# File lib/placemaker/xml_parser.rb 20 def document_length 21 @xml.xpath('.//xmlns:documentLength').inner_text.to_i 22 end
documents()
click to toggle source
Returns a set of Placemaker::Document
objects as containers for content location information
# File lib/placemaker/xml_parser.rb 25 def documents 26 @xml.xpath('//xmlns:document', 'xmlns' => 'http://wherein.yahooapis.com/v1/schema').map do |d| 27 Placemaker::Document.new(d) 28 end 29 end
processing_time()
click to toggle source
time in seconds to process the document
# File lib/placemaker/xml_parser.rb 10 def processing_time 11 @xml.xpath('.//xmlns:processingTime').inner_text.to_f 12 end
version()
click to toggle source
version of the software used to process the document
# File lib/placemaker/xml_parser.rb 15 def version 16 @xml.xpath('.//xmlns:version').inner_text.strip 17 end