class Heroku::Git::Version

Attributes

major[RW]
minor[RW]
patch[RW]
special[RW]

Public Class Methods

new(major, minor=0, patch=0, special=0) click to toggle source
# File lib/heroku/git.rb, line 53
def initialize(major, minor=0, patch=0, special=0)
  @major, @minor, @patch, @special = major, minor, patch, special
end
parse(s) click to toggle source
# File lib/heroku/git.rb, line 57
def self.parse(s)
  digits = s.split('.').map { |i| i.to_i }
  Version.new(*digits)
end

Public Instance Methods

<=>(other) click to toggle source
# File lib/heroku/git.rb, line 62
def <=>(other)
  return major <=> other.major unless (major <=> other.major) == 0
  return minor <=> other.minor unless (minor <=> other.minor) == 0
  return patch <=> other.patch unless (patch <=> other.patch) == 0
  return special <=> other.special
end