Class: Pubid::Iso::Components::Code
- Inherits:
-
Components::Code
- Object
- Lutaml::Model::Serializable
- Components::Code
- Pubid::Iso::Components::Code
- Defined in:
- lib/pubid/iso/components/code.rb
Instance Method Summary collapse
Methods inherited from Components::Code
Instance Method Details
#==(other) ⇒ Object
28 29 30 31 32 |
# File 'lib/pubid/iso/components/code.rb', line 28 def ==(other) return false unless other.is_a?(Code) value == other.value && parts == other.parts end |
#render(context: nil) ⇒ Object
16 17 18 19 20 |
# File 'lib/pubid/iso/components/code.rb', line 16 def render(context: nil) result = value.to_s result += parts.map { |p| "-#{p}" }.join if parts&.any? result end |
#to_s ⇒ Object
22 23 24 25 26 |
# File 'lib/pubid/iso/components/code.rb', line 22 def to_s result = value.to_s result += parts.map { |p| "-#{p}" }.join if parts&.any? result end |
#value ⇒ Object
12 13 14 |
# File 'lib/pubid/iso/components/code.rb', line 12 def value number || self[:value] end |