Class: Pubid::Oiml::SingleIdentifier
- Inherits:
-
Identifier
- Object
- Lutaml::Model::Serializable
- Identifier
- Identifier
- Pubid::Oiml::SingleIdentifier
- Defined in:
- lib/pubid/oiml/single_identifier.rb
Direct Known Subclasses
Identifiers::BasicPublication, Identifiers::Document, Identifiers::ExpertReport, Identifiers::Guide, Identifiers::Recommendation, Identifiers::SeminarReport, Identifiers::Vocabulary
Instance Attribute Summary collapse
-
#requested_format ⇒ Object
readonly
Track parsed format.
Instance Method Summary collapse
- #edition_portion ⇒ Object
- #to_s(format: nil, **opts) ⇒ Object
-
#type ⇒ Object
Type is determined by the subclass.
-
#type_string ⇒ Object
Subclasses override this.
Methods inherited from Identifier
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, #year
Constructor Details
This class inherits a constructor from Pubid::Identifier
Instance Attribute Details
#requested_format ⇒ Object (readonly)
Track parsed format
18 19 20 |
# File 'lib/pubid/oiml/single_identifier.rb', line 18 def requested_format @requested_format end |
Instance Method Details
#edition_portion ⇒ Object
31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/pubid/oiml/single_identifier.rb', line 31 def edition_portion # Deprecated - kept for compatibility # Use to_s(format: :long) instead if edition && date "#{edition} Edition #{date.year}" elsif date "Edition #{date.year}" else edition end end |
#to_s(format: nil, **opts) ⇒ Object
25 26 27 28 29 |
# File 'lib/pubid/oiml/single_identifier.rb', line 25 def to_s(format: nil, **opts) # Store requested format so the renderer can access it @requested_format = format render(format: :human, **opts) end |
#type ⇒ Object
Type is determined by the subclass
21 22 23 |
# File 'lib/pubid/oiml/single_identifier.rb', line 21 def type type_string end |
#type_string ⇒ Object
Subclasses override this
44 45 46 |
# File 'lib/pubid/oiml/single_identifier.rb', line 44 def type_string raise NotImplementedError, "Subclasses must implement type_string" end |