Class: Metanorma::Tools::DocumentMetadata

Inherits:
Lutaml::Model::Serializable
  • Object
show all
Defined in:
lib/metanorma/tools/document_metadata.rb

Instance Method Summary collapse

Instance Method Details

#auto_prefixObject



20
21
22
23
24
25
26
27
28
29
# File 'lib/metanorma/tools/document_metadata.rb', line 20

def auto_prefix
  case flavor
  when 'iso'
    # ISO DRG format: {StandardNumber}_{stageCode}_ed{editionNumber}
    "#{standard_number}_#{stage_abbreviation&.downcase}_ed#{edition}"
  else
    # For other flavors, use a generic pattern
    "#{flavor}_#{standard_number}_#{stage_abbreviation&.downcase}_ed#{edition}"
  end
end

#to_sObject



31
32
33
34
35
36
37
# File 'lib/metanorma/tools/document_metadata.rb', line 31

def to_s
  if docidentifier
    "#{docidentifier} - #{title}"
  else
    "ISO #{standard_number} Edition #{edition} Stage #{stage_code} (#{stage_abbreviation})"
  end
end