Module: Relaton::Itu::Bibliography
Instance Method Summary collapse
- #get(code, year = nil, opts = {}) ⇒ Relaton::Bib::ItemData?
- #search(refid) ⇒ Relaton::Itu::HitCollection
Instance Method Details
#get(code, year = nil, opts = {}) ⇒ Relaton::Bib::ItemData?
22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/relaton/itu/bibliography.rb', line 22 def get(code, year = nil, opts = {}) warn_incorrect_ref(code) refid = Pubid.parse code refid.year ||= year ret = itubib_get1(refid) return nil if ret.nil? ret = ret.to_most_recent_reference unless refid.year || opts[:keep_year] ret = ret.to_all_parts if opts[:all_parts] ret end |
#search(refid) ⇒ Relaton::Itu::HitCollection
10 11 12 13 14 15 16 |
# File 'lib/relaton/itu/bibliography.rb', line 10 def search(refid) if refid.is_a? String warn_incorrect_ref(refid) refid = Pubid.parse refid end HitCollection.new(refid).tap(&:search) end |