Module: Pubid::Etsi::Identifier

Extended by:
Core::Identifier
Defined in:
lib/pubid/etsi/identifier.rb,
lib/pubid/etsi/identifier/base.rb,
lib/pubid/etsi/identifier/amendment.rb,
lib/pubid/etsi/identifier/supplement.rb,
lib/pubid/etsi/identifier/corrigendum.rb

Defined Under Namespace

Classes: Amendment, Base, Corrigendum, Supplement

Class Method Summary collapse

Class Method Details

.parse(*args) ⇒ Object

See Also:

  • Identifier::Base.parse


7
8
9
# File 'lib/pubid/etsi/identifier.rb', line 7

def parse(*args)
  Base.parse(*args)
end

.resolve_identifier(parameters = {}) ⇒ Object



11
12
13
14
15
16
17
18
19
20
21
# File 'lib/pubid/etsi/identifier.rb', line 11

def resolve_identifier(parameters = {})
  return @config.default_type.new(**parameters) if parameters[:type].nil?

  @config.types.each do |identifier_type|
    if identifier_type.type_match?(parameters)
      return identifier_type.new(**parameters.reject { |k, _| k == :type })
    end
  end

  @config.default_type.new(**parameters)
end