Class: Pubid::Csa::WrapperIdentifier

Inherits:
Lutaml::Model::Serializable
  • Object
show all
Defined in:
lib/pubid/csa/wrapper_identifier.rb

Overview

WrapperIdentifier is the base class for all CSA identifiers that wrap other identifiers Examples:

- CanadianAdoptedIdentifier: CAN/{wrapped_identifier}
- CsaAdoptedIdentifier: CSA {ISO/IEC/CISPR identifier}

The wrapper pattern allows proper MODEL-DRIVEN architecture where adoptions are objects that contain other identifier objects, not string prefixes.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#wrapped_identifierObject

The wrapped identifier (recursively parsed) Use attr_accessor since it can be any identifier object (CSA, ISO, IEC, etc.)



17
18
19
# File 'lib/pubid/csa/wrapper_identifier.rb', line 17

def wrapped_identifier
  @wrapped_identifier
end

Instance Method Details

#to_sObject

Subclasses MUST implement to_s

Raises:

  • (NotImplementedError)


26
27
28
# File 'lib/pubid/csa/wrapper_identifier.rb', line 26

def to_s
  raise NotImplementedError, "Subclasses must implement to_s method"
end