Class: Pubid::Oiml::SupplementIdentifier
- Inherits:
-
Identifier
- Object
- Identifier
- Identifier
- Pubid::Oiml::SupplementIdentifier
- Defined in:
- lib/pubid/oiml/supplement_identifier.rb
Direct Known Subclasses
Identifiers::Amendment, Identifiers::Annex, Identifiers::Errata
Constant Summary
Constants inherited from Identifier
Instance Attribute Summary collapse
-
#requested_format ⇒ Object
readonly
Returns the value of attribute requested_format.
Instance Method Summary collapse
- #base_identifier_from_kv(model, value) ⇒ Object
- #base_identifier_to_kv(model, doc) ⇒ Object
-
#supplement_type ⇒ Object
Subclasses override this.
- #to_s(format: nil, **opts) ⇒ Object
Methods inherited from Identifier
Instance Attribute Details
#requested_format ⇒ Object (readonly)
Returns the value of attribute requested_format.
48 49 50 |
# File 'lib/pubid/oiml/supplement_identifier.rb', line 48 def requested_format @requested_format end |
Instance Method Details
#base_identifier_from_kv(model, value) ⇒ Object
44 45 46 |
# File 'lib/pubid/oiml/supplement_identifier.rb', line 44 def base_identifier_from_kv(model, value) model.base_identifier = ::Pubid::Oiml::Identifier.from_hash(value) if value end |
#base_identifier_to_kv(model, doc) ⇒ Object
34 35 36 37 38 39 40 41 42 |
# File 'lib/pubid/oiml/supplement_identifier.rb', line 34 def base_identifier_to_kv(model, doc) base = model.base_identifier return unless base doc.add_child( Lutaml::KeyValue::DataModel::Element.new("base_identifier", base.to_hash), ) end |
#supplement_type ⇒ Object
Subclasses override this
56 57 58 |
# File 'lib/pubid/oiml/supplement_identifier.rb', line 56 def supplement_type raise NotImplementedError, "Subclasses must implement supplement_type" end |
#to_s(format: nil, **opts) ⇒ Object
50 51 52 53 |
# File 'lib/pubid/oiml/supplement_identifier.rb', line 50 def to_s(format: nil, **opts) @requested_format = format render(format: :human, **opts) end |