Class: ElsevierApi::XMLResponse::Searchresults
- Inherits:
-
XMLResponseGeneric
- Object
- XMLResponseGeneric
- ElsevierApi::XMLResponse::Searchresults
- Defined in:
- lib/elsevier_api/xml_response/search_results.rb
Instance Attribute Summary
Attributes inherited from XMLResponseGeneric
Instance Method Summary collapse
Methods inherited from XMLResponseGeneric
#initialize, #process, #process_path
Constructor Details
This class inherits a constructor from ElsevierApi::XMLResponse::XMLResponseGeneric
Instance Method Details
#entries_to_ary ⇒ Object
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/elsevier_api/xml_response/search_results.rb', line 35 def entries_to_ary @xml.xpath("//atom:entry").map {|v| title=v.at_xpath("dc:title").nil? ? nil : v.at_xpath("dc:title").text journal=v.at_xpath("prism:publicationName").nil? ? nil : v.at_xpath("prism:publicationName").text h={ :scopus_id=>v.at_xpath("dc:identifier").text, :title=>title, :journal=>journal } {:creator=>"dc:creator",:doi=>"prism:doi"}.each_pair {|key,xv| h[key]=v.at_xpath(xv).text unless v.at_xpath(xv).nil? } h } end |
#next_page ⇒ Object
32 33 34 |
# File 'lib/elsevier_api/xml_response/search_results.rb', line 32 def next_page @xml.at_xpath("//atom:link[@ref='next']") end |