Class: ComparableVersion
- Inherits:
-
Array
- Object
- Array
- ComparableVersion
- Defined in:
- lib/gem_velocity/helpers.rb
Overview
Instance Method Summary collapse
- #<(x) ⇒ Object
- #==(x) ⇒ Object
- #>(x) ⇒ Object
-
#initialize(s) ⇒ ComparableVersion
constructor
A new instance of ComparableVersion.
- #str ⇒ Object
Constructor Details
#initialize(s) ⇒ ComparableVersion
Returns a new instance of ComparableVersion.
43 44 45 46 |
# File 'lib/gem_velocity/helpers.rb', line 43 def initialize s @str = s super(s.split('.').map { |e| e.to_i }) end |
Instance Method Details
#<(x) ⇒ Object
50 51 52 |
# File 'lib/gem_velocity/helpers.rb', line 50 def < x (self <=> x) < 0 end |
#==(x) ⇒ Object
56 57 58 |
# File 'lib/gem_velocity/helpers.rb', line 56 def == x (self <=> x) == 0 end |
#>(x) ⇒ Object
53 54 55 |
# File 'lib/gem_velocity/helpers.rb', line 53 def > x (self <=> x) > 0 end |
#str ⇒ Object
47 48 49 |
# File 'lib/gem_velocity/helpers.rb', line 47 def str @str end |