Class: Pubid::CenCenelec::Identifiers::AdoptedEuropeanNorm
- Inherits:
-
EuropeanNorm
- Object
- Lutaml::Model::Serializable
- Identifier
- Pubid::CenCenelec::Identifier
- SingleIdentifier
- EuropeanNorm
- Pubid::CenCenelec::Identifiers::AdoptedEuropeanNorm
- Defined in:
- lib/pubid/cen_cenelec/identifiers/adopted_european_norm.rb
Overview
AdoptedEuropeanNorm wraps ISO/IEC identifiers Example: "EN ISO 8601:2019" where ISO 8601:2019 is an ISO identifier object
Constant Summary
Constants inherited from EuropeanNorm
Class Method Summary collapse
-
.type ⇒ Object
Override self.type to return nil so that AdoptedEuropeanNorm is NOT registered as a type in CenCenelec.identifier_types.
Instance Method Summary collapse
- #date ⇒ Object
-
#number ⇒ Object
Delegate common methods to adopted identifier.
- #part ⇒ Object
- #parts ⇒ Object
- #year ⇒ Object
Methods inherited from SingleIdentifier
Methods inherited from Pubid::CenCenelec::Identifier
Methods inherited from Identifier
#base_identifier, #eql?, #exclude, from_hash, #hash, #initialize, #mr_number, #mr_number_with_part, #mr_part, #mr_publisher, #mr_type, #mr_year, #new_edition_of?, polymorphic_name, polymorphic_type_map, #render, #resolve_urn_generator, #root, #to_hash, #to_mr_string, #to_s, #to_supplement_s, #to_urn, #urn_supplement_type, #urn_type_code
Constructor Details
This class inherits a constructor from Pubid::Identifier
Class Method Details
.type ⇒ Object
Override self.type to return nil so that AdoptedEuropeanNorm is NOT registered as a type in CenCenelec.identifier_types. The class is a polymorphic wrapper that wraps an adopted ISO/IEC identifier under an EN publisher; it is constructed explicitly by Builder#build_adopted_identifier, not selected via type-code lookup. Returning nil here prevents identifier_types auto-discovery from shadowing EuropeanNorm (which also reports :en) in CenCenelec.locate_type(:en).
18 19 20 |
# File 'lib/pubid/cen_cenelec/identifiers/adopted_european_norm.rb', line 18 def self.type nil end |
Instance Method Details
#date ⇒ Object
31 32 33 |
# File 'lib/pubid/cen_cenelec/identifiers/adopted_european_norm.rb', line 31 def date adopted_identifier&.date if adopted_identifier&.methods&.include?(:date) end |
#number ⇒ Object
Delegate common methods to adopted identifier
23 24 25 |
# File 'lib/pubid/cen_cenelec/identifiers/adopted_european_norm.rb', line 23 def number adopted_identifier&.number end |
#part ⇒ Object
39 40 41 |
# File 'lib/pubid/cen_cenelec/identifiers/adopted_european_norm.rb', line 39 def part adopted_identifier&.part if adopted_identifier&.methods&.include?(:part) end |
#parts ⇒ Object
35 36 37 |
# File 'lib/pubid/cen_cenelec/identifiers/adopted_european_norm.rb', line 35 def parts adopted_identifier&.parts if adopted_identifier&.methods&.include?(:parts) end |
#year ⇒ Object
27 28 29 |
# File 'lib/pubid/cen_cenelec/identifiers/adopted_european_norm.rb', line 27 def year adopted_identifier&.year if adopted_identifier&.methods&.include?(:year) end |