Class: Pubid::Etsi::Components::Version
- Inherits:
-
Lutaml::Model::Serializable
- Object
- Lutaml::Model::Serializable
- Pubid::Etsi::Components::Version
- Defined in:
- lib/pubid/etsi/components/version.rb
Overview
Represents an ETSI version string Format: V1.2.3, V2.0.0, or ed.1
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(version:, is_edition: false) ⇒ Version
constructor
true for ed.N format.
- #to_s ⇒ Object
Constructor Details
#initialize(version:, is_edition: false) ⇒ Version
true for ed.N format
16 17 18 19 |
# File 'lib/pubid/etsi/components/version.rb', line 16 def initialize(version:, is_edition: false) @version = version @is_edition = is_edition end |
Instance Method Details
#==(other) ⇒ Object
29 30 31 32 33 |
# File 'lib/pubid/etsi/components/version.rb', line 29 def ==(other) return false unless other.is_a?(Version) version == other.version && is_edition == other.is_edition end |
#to_s ⇒ Object
21 22 23 24 25 26 27 |
# File 'lib/pubid/etsi/components/version.rb', line 21 def to_s if is_edition "ed.#{version}" else "V#{version}" end end |