Class: SemverDialects::Semver2::Version
- Inherits:
-
BaseVersion
- Object
- BaseVersion
- SemverDialects::Semver2::Version
- Defined in:
- lib/semver_dialects/semver2.rb
Overview
rubocop:todo Style/Documentation
Instance Attribute Summary
Attributes inherited from BaseVersion
Instance Method Summary collapse
- #<=>(other) ⇒ Object
-
#initialize(tokens, prerelease_tag: nil) ⇒ Version
constructor
rubocop:todo Lint/MissingSuper.
Methods inherited from BaseVersion
Constructor Details
#initialize(tokens, prerelease_tag: nil) ⇒ Version
rubocop:todo Lint/MissingSuper
11 12 13 14 |
# File 'lib/semver_dialects/semver2.rb', line 11 def initialize(tokens, prerelease_tag: nil) # rubocop:todo Lint/MissingSuper @tokens = tokens @addition = prerelease_tag end |
Instance Method Details
#<=>(other) ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/semver_dialects/semver2.rb', line 16 def <=>(other) if (idx = tokens.index(ANY_NUMBER)) a = tokens[0..(idx - 1)] b = other.tokens[0..(idx - 1)] return compare_tokens(a, b) end if (idx = other.tokens.index(ANY_NUMBER)) a = tokens[0..(idx - 1)] b = other.tokens[0..(idx - 1)] return compare_tokens(a, b) end super end |