class ComparableVersion

stackoverflow.com/questions/2051229/how-to-compare-versions-in-ruby

Public Class Methods

new(s) click to toggle source
Calls superclass method
# File lib/gem_velocity/helpers.rb, line 43
def initialize s
  @str = s
  super(s.split('.').map { |e| e.to_i })
end

Public Instance Methods

<(x) click to toggle source
# File lib/gem_velocity/helpers.rb, line 50
def < x
  (self <=> x) < 0
end
==(x) click to toggle source
# File lib/gem_velocity/helpers.rb, line 56
def == x
  (self <=> x) == 0
end
>(x) click to toggle source
# File lib/gem_velocity/helpers.rb, line 53
def > x
  (self <=> x) > 0
end
str() click to toggle source
# File lib/gem_velocity/helpers.rb, line 47
def str
  @str
end