class Version

Attributes

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

Public Class Methods

new(version_string) click to toggle source
# File lib/build_promotion_tool/comparator/version.rb, line 5
def initialize(version_string)
  array = version_string.split(".")
  self.major = array[0].to_i
  self.minor = array[1].to_i
  self.patch = array[2].to_i
end

Public Instance Methods

<=>(other) click to toggle source
# File lib/build_promotion_tool/comparator/version.rb, line 16
def <=>(other)
  return nil if self.class != other.class
  [self.major, self.minor, self.patch] <=> [other.major, other.minor, other.patch]
end
==(other) click to toggle source
# File lib/build_promotion_tool/comparator/version.rb, line 12
def ==(other)
  other.class == self.class && other.major == self.major && other.minor == self.minor && other.patch == self.patch
end