Class: Pubid::Iec::Components::VapSuffix

Inherits:
Lutaml::Model::Serializable
  • Object
show all
Defined in:
lib/pubid/iec/components/vap_suffix.rb

Overview

VAP (Validation Assessment Programme) suffix codes Single Responsibility: Represents VAP validation status suffixes

Constant Summary collapse

CODES =

VAP suffix codes as defined by IEC

{
  "CMV" => "Common Modifications and Variations",
  "RLV" => "Relevant",
  "SER" => "Serial",
}.freeze

Instance Method Summary collapse

Instance Method Details

#full_nameObject



30
31
32
# File 'lib/pubid/iec/components/vap_suffix.rb', line 30

def full_name
  CODES[code]
end

#render_with_spaceObject

VAP suffix appears after the main identifier with a space



35
36
37
# File 'lib/pubid/iec/components/vap_suffix.rb', line 35

def render_with_space
  " #{code}"
end

#to_sObject



26
27
28
# File 'lib/pubid/iec/components/vap_suffix.rb', line 26

def to_s
  code
end

#validate!Object



19
20
21
22
23
24
# File 'lib/pubid/iec/components/vap_suffix.rb', line 19

def validate!
  unless CODES.key?(code)
    raise ArgumentError,
          "Unknown VAP suffix code: #{code}. Valid codes: #{CODES.keys.join(', ')}"
  end
end