Class: ConvenientService::Dependencies::Queries::Version
- Inherits:
-
Object
- Object
- ConvenientService::Dependencies::Queries::Version
- Includes:
- Comparable
- Defined in:
- lib/convenient_service/dependencies/queries/version.rb,
lib/convenient_service/dependencies/queries/version/null_version.rb
Defined Under Namespace
Classes: NullVersion
Class Method Summary collapse
Instance Method Summary collapse
- #<=>(other) ⇒ Boolean?
- #gem_version ⇒ Gem::Version?
- #initialize(value) ⇒ void constructor
- #major_minor ⇒ String
- #null_version? ⇒ Boolean
- #to_s ⇒ String
Constructor Details
#initialize(value) ⇒ void
19 20 21 |
# File 'lib/convenient_service/dependencies/queries/version.rb', line 19 def initialize(value) @value = value end |
Class Method Details
.null_version ⇒ ConvenientService::Dependencies::Queries::Version::NullVersion
27 28 29 |
# File 'lib/convenient_service/dependencies/queries/version.rb', line 27 def null_version @null_version ||= Version::NullVersion.new end |
Instance Method Details
#<=>(other) ⇒ Boolean?
60 61 62 |
# File 'lib/convenient_service/dependencies/queries/version.rb', line 60 def <=>(other) gem_version <=> cast_gem_version(other) end |
#gem_version ⇒ Gem::Version?
42 43 44 |
# File 'lib/convenient_service/dependencies/queries/version.rb', line 42 def gem_version cast_gem_version(value) end |
#major_minor ⇒ String
52 53 54 |
# File 'lib/convenient_service/dependencies/queries/version.rb', line 52 def major_minor to_s[/\d+\.\d+/] end |
#null_version? ⇒ Boolean
35 36 37 |
# File 'lib/convenient_service/dependencies/queries/version.rb', line 35 def null_version? false end |
#to_s ⇒ String
67 68 69 |
# File 'lib/convenient_service/dependencies/queries/version.rb', line 67 def to_s gem_version.to_s end |