320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
|
# File 'lib/bibliographical_importer/bibtex.rb', line 320
def self.generate(canonical_documents)
bib = BibTeX::Bibliography.new
canonical_documents.each do |cd|
campos=[:title, :abstract, :journal, :year, :volume, :pages,
:doi, :url, :author, :scopus_id, :wos_id, :scielo_id]
hash_c=campos.inject({}) {|ac,v|
ac[v]=cd.send(v)
ac
}
hash_c[:bibtex_type]=:article
hash_c[:key]="key_#{cd[:id]}_#{cd[:year]}"
bib << BibTeX::Entry.new(hash_c)
end
bib
end
|