Class: Scopus::XMLResponse::Searchresults
Instance Method Summary
collapse
Instance Method Details
#entries_to_hash ⇒ Object
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
|
# File 'lib/scopus/xml_response/search_results.rb', line 35
def entries_to_hash
@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/scopus/xml_response/search_results.rb', line 32
def next_page
@xml.at_xpath("//atom:link[@ref='next']")
end
|