Class: Relaton::ThreeGpp::ItemData

Inherits:
Bib::ItemData
  • Object
show all
Defined in:
lib/relaton/3gpp/item_data.rb

Instance Method Summary collapse

Instance Method Details

#create_id(without_date: false) ⇒ Object



4
5
6
7
8
9
10
11
12
# File 'lib/relaton/3gpp/item_data.rb', line 4

def create_id(without_date: false)
  return id if id && !id.empty?

  docid = find_primary_docid
  return unless docid

  pubid = without_date ? docid.content.sub(/:\d{4}$/, "") : docid.content
  self.id = pubid.to_s.sub(/\A3GPP\s+/, "").gsub(/\W+/, "")
end