Class: Dependabot::Devcontainers::Version
- Inherits:
-
Version
- Object
- Version
- Dependabot::Devcontainers::Version
- Extended by:
- T::Sig
- Defined in:
- lib/dependabot/devcontainers/version.rb
Instance Method Summary collapse
- #<=>(other) ⇒ Object
- #same_precision?(other) ⇒ Boolean
- #satisfies?(requirement) ⇒ Boolean
- #truncate(target_precision) ⇒ Object
- #truncate_to_precision_of(other) ⇒ Object
Instance Method Details
#<=>(other) ⇒ Object
35 36 37 38 39 40 41 |
# File 'lib/dependabot/devcontainers/version.rb', line 35 def <=>(other) if self == other precision <=> other.precision else super end end |
#same_precision?(other) ⇒ Boolean
15 16 17 |
# File 'lib/dependabot/devcontainers/version.rb', line 15 def same_precision?(other) precision == other.precision end |
#satisfies?(requirement) ⇒ Boolean
30 31 32 |
# File 'lib/dependabot/devcontainers/version.rb', line 30 def satisfies?(requirement) requirement.satisfied_by?(self) end |
#truncate(target_precision) ⇒ Object
20 21 22 |
# File 'lib/dependabot/devcontainers/version.rb', line 20 def truncate(target_precision) T.cast(self.class.new(segments.first(target_precision).join(".")), Dependabot::Devcontainers::Version) end |
#truncate_to_precision_of(other) ⇒ Object
25 26 27 |
# File 'lib/dependabot/devcontainers/version.rb', line 25 def truncate_to_precision_of(other) truncate(other.precision) end |