Class: Semverse::Version
- Inherits:
-
Object
- Object
- Semverse::Version
- Defined in:
- lib/elm_install/ext.rb
Overview
Added utility functions
Class Method Summary collapse
-
.try_new(version) ⇒ Semverse::Version
Tries to parse a version, falling back to nil if fails.
Instance Method Summary collapse
-
#to_simple ⇒ String
Returns the simple string representation of a version.
Class Method Details
.try_new(version) ⇒ Semverse::Version
Tries to parse a version, falling back to nil if fails.
17 18 19 20 21 |
# File 'lib/elm_install/ext.rb', line 17 def self.try_new(version) new version rescue nil end |
Instance Method Details
#to_simple ⇒ String
Returns the simple string representation of a version
8 9 10 |
# File 'lib/elm_install/ext.rb', line 8 def to_simple "#{major}.#{minor}.#{patch}" end |