Class: Pubid::Cie::Identifier

Inherits:
Identifier
  • Object
show all
Defined in:
lib/pubid/cie/identifier.rb

Overview

Base Identifier class for CIE.

Inherits the shared Pubid::Identifier contract (format_registry, render, to_urn, exclude, hash, eql?) while allowing CIE-specific attributes.

style is the sole number<->year separator field (there is no separate date_separator): "current" -> ":", "legacy" -> "-", "slash" -> "/". It defaults to "current" (the dominant value), so canonicalize_hash drops it from the majority of rows and from_hash restores it.

Direct Known Subclasses

SingleIdentifier, SupplementIdentifier

Class Method Summary collapse

Methods inherited from Identifier

apply_mappings, #base, #base_document, concrete_class_for, #dated_version_of?, #draft_of?, #drop_supplements, #edition_of?, #eql?, #exclude, from_hash, #has_supplement?, #hash, #includes?, #initialize, #matches?, #mr_all_parts, #mr_edition, #mr_languages, #mr_number, #mr_number_with_part, #mr_part, #mr_publisher, #mr_subpart, #mr_supplement_suffix, #mr_type, #mr_year, #new_edition_of?, polymorphic_name, polymorphic_type_map, #related_to?, #render, #resolve_urn_generator, #root, #sibling_of?, #supplement_of?, #to_hash, #to_mr_string, #to_s, #to_slug, #to_supplement_s, #to_urn, #urn_supplement_type, #urn_type_code, #year

Constructor Details

This class inherits a constructor from Pubid::Identifier

Class Method Details

.parse(input) ⇒ Object



17
18
19
20
21
22
23
24
25
# File 'lib/pubid/cie/identifier.rb', line 17

def self.parse(input)
  if input.length > Pubid::MAX_INPUT_LENGTH
    raise ArgumentError, Pubid::INPUT_TOO_LONG_MESSAGE
  end

  parsed = Parser.parse(input)
  builder = Builder.new
  builder.build(parsed, original_string: input)
end