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
31 32 33 |
# File 'lib/pubid/oiml/components/code.rb', line 31 def render(context: nil) to_s end |
#to_s ⇒ Object
23 24 25 26 27 28 29 |
# File 'lib/pubid/oiml/components/code.rb', line 23 def to_s result = number.to_s result += "-#{part}" if part result += "-#{subpart}" if subpart result += "#{space_suffix ? ' ' : '-'}#{suffix}" if suffix result end |