Class: Pubid::Bsi::Identifiers::AdoptedInternationalStandard

Inherits:
BritishStandard show all
Defined in:
lib/pubid/bsi/identifiers/adopted_international_standard.rb

Overview

AdoptedInternationalStandard wraps ISO/IEC identifiers directly Example: “BS ISO 8601:2019” where ISO 8601:2019 is an ISO identifier object Example: “BS IEC 62600:2020” where IEC 62600:2020 is an IEC identifier object

Constant Summary

Constants inherited from BritishStandard

BritishStandard::TYPED_STAGES

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from SingleIdentifier

#<=>, #publisher

Methods included from Pubid::Bsi::Identifier

parse

Methods included from IdentifierFacade

#from_hash, #polymorphic_type_map

Methods inherited from Identifier

#base_identifier, #eql?, #exclude, #hash, #initialize, #mr_number, #mr_number_with_part, #mr_part, #mr_publisher, #mr_type, #mr_year, #new_edition_of?, polymorphic_name, #render, #resolve_urn_generator, #root, #to_mr_string, #to_supplement_s, #to_urn, #urn_supplement_type, #urn_type_code

Constructor Details

This class inherits a constructor from Pubid::Identifier

Class Method Details

.typeObject

Override self.type to return nil so this polymorphic wrapper is not registered as a base type. Inherits ‘:bs` from BritishStandard which would otherwise shadow it in Bsi.locate_type(:bs) auto-discovery. AdoptedInternationalStandard is constructed explicitly by the builder, not selected by type-code lookup.



24
25
26
# File 'lib/pubid/bsi/identifiers/adopted_international_standard.rb', line 24

def self.type
  nil
end

Instance Method Details

#dateObject



41
42
43
# File 'lib/pubid/bsi/identifiers/adopted_international_standard.rb', line 41

def date
  adopted_identifier&.date if adopted_identifier&.methods&.include?(:date)
end

#numberObject

Delegate common methods to adopted identifier



33
34
35
# File 'lib/pubid/bsi/identifiers/adopted_international_standard.rb', line 33

def number
  adopted_identifier&.number
end

#partObject



49
50
51
# File 'lib/pubid/bsi/identifiers/adopted_international_standard.rb', line 49

def part
  adopted_identifier&.part if adopted_identifier&.methods&.include?(:part)
end

#partsObject



45
46
47
# File 'lib/pubid/bsi/identifiers/adopted_international_standard.rb', line 45

def parts
  adopted_identifier&.parts if adopted_identifier&.methods&.include?(:parts)
end

#to_sObject



28
29
30
# File 'lib/pubid/bsi/identifiers/adopted_international_standard.rb', line 28

def to_s
  render(format: :human)
end

#yearObject



37
38
39
# File 'lib/pubid/bsi/identifiers/adopted_international_standard.rb', line 37

def year
  adopted_identifier&.year if adopted_identifier&.methods&.include?(:year)
end