Class: Wikipedia::VandalismDetection::PageParser
- Inherits:
-
Object
- Object
- Wikipedia::VandalismDetection::PageParser
- Defined in:
- lib/wikipedia/vandalism_detection/page_parser.rb
Instance Method Summary collapse
-
#parse(xml) ⇒ Object
Parses an xml string and returns a Wikipedia::VandalismDetection::Page.
Instance Method Details
#parse(xml) ⇒ Object
Parses an xml string and returns a Wikipedia::VandalismDetection::Page.
10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/wikipedia/vandalism_detection/page_parser.rb', line 10 def parse(xml) @page = Page.new document = Nokogiri::XML(xml, nil, 'UTF-8') @page.title = document.xpath('//page/title').inner_text @page.id = document.xpath('//page/id').inner_text build_revisions_from document @page end |