Class: RelatonIso::DocumentIdentifier

Inherits:
RelatonBib::DocumentIdentifier
  • Object
show all
Defined in:
lib/relaton_iso/document_identifier.rb

Instance Method Summary collapse

Instance Method Details

#all_partsObject



23
24
25
# File 'lib/relaton_iso/document_identifier.rb', line 23

def all_parts
  @all_parts = true
end

#idObject



3
4
5
6
7
8
9
10
11
12
13
# File 'lib/relaton_iso/document_identifier.rb', line 3

def id
  id_str = @id.to_s.sub(/\sED\d+/, "").squeeze(" ").sub(/^ISO\/\s/, "ISO ") # workarounds for pubid gem bugs
  if @all_parts
    if type == "URN"
      return "#{@id.urn}:ser"
    else
      return "#{id_str} (all parts)"
    end
  end
  type == "URN" ? @id.urn.to_s : id_str
end

#remove_dateObject



19
20
21
# File 'lib/relaton_iso/document_identifier.rb', line 19

def remove_date
  @id.year = nil
end

#remove_partObject



15
16
17
# File 'lib/relaton_iso/document_identifier.rb', line 15

def remove_part
  @id.part = nil
end