Class: Pubid::Oiml::Components::Code
- Inherits:
-
Lutaml::Model::Serializable
- Object
- Lutaml::Model::Serializable
- Pubid::Oiml::Components::Code
- Defined in:
- lib/pubid/oiml/components/code.rb
Overview
Code component for OIML identifiers.
Stays independent of Pubid::Components::Code because OIML uses number as the primary field (shared Code uses value). The shape is otherwise compatible; a future rename of number →value would let this become a subclass.
Instance Method Summary collapse
Instance Method Details
#render(context: nil) ⇒ Object
24 25 26 |
# File 'lib/pubid/oiml/components/code.rb', line 24 def render(context: nil) to_s end |
#to_s ⇒ Object
17 18 19 20 21 22 |
# File 'lib/pubid/oiml/components/code.rb', line 17 def to_s result = number.to_s result += "-#{part}" if part result += "-#{subpart}" if subpart result end |