Class: RelatonIec::DocumentIdentifier

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

Instance Method Summary collapse

Instance Method Details

#all_partsObject



28
29
30
31
32
# File 'lib/relaton_iec/document_identifier.rb', line 28

def all_parts
  return super unless @id.is_a?(Pubid::Iec::Base)

  @all_parts = true
end

#idObject



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

def id
  return @id unless @id.is_a?(Pubid::Iec::Base)

  if @all_parts
    if type == "URN"
      return "#{@id.urn}:ser"
    else
      return "#{@id} (all parts)"
    end
  end
  type == "URN" ? @id.urn.to_s : @id.to_s
end

#remove_dateObject



22
23
24
25
26
# File 'lib/relaton_iec/document_identifier.rb', line 22

def remove_date
  return super unless @id.respond_to?(:year=)

  @id.year = nil
end

#remove_partObject



16
17
18
19
20
# File 'lib/relaton_iec/document_identifier.rb', line 16

def remove_part
  return super unless @id.respond_to?(:part=)

  @id.part = nil
end