Sha256: 0eddf5e18da3fd27eed32cbebd644159e352633c0e6f49448a0143d47a509942
Contents?: true
Size: 1.29 KB
Versions: 14
Compression:
Stored size: 1.29 KB
Contents
# frozen_string_literal: true require_relative "version/null_version" module ConvenientService module Support class Version include ::Comparable undef_method :between? undef_method :clamp ## # @param value [String] # @return [void] # def initialize(value) @value = value end class << self ## # @return [ConvenientService::Support::Version::NullVersion] # def null_version @null_version ||= Support::Version::NullVersion.new end end ## # @return [Boolean] # def null_version? false end ## # @return [Gem::Version, nil] # def gem_version cast_gem_version(value) end ## # @param other [Object] Can be any type. # @return [Boolean, nil] # def <=>(other) gem_version <=> cast_gem_version(other) end ## # @return [String] # def to_s gem_version.to_s end private ## # @return [String] # attr_reader :value ## # @return [Gem::Version, nil] # def cast_gem_version(value) ::Gem::Version.create(value.to_s) if ::Gem::Version.correct?(value.to_s) end end end end
Version data entries
14 entries across 14 versions & 1 rubygems