class MGit::AppData::AppDataVersion

Base class for data storage versions. #

Public Class Methods

active() click to toggle source
# File lib/mgit/appdata.rb, line 45
def self.active
  sorted.find { |v| v.active? }
end
inherited(version) click to toggle source
Calls superclass method
# File lib/mgit/appdata.rb, line 31
def self.inherited(version)
  @versions ||= []
  @versions << version.new
  super
end
latest() click to toggle source
# File lib/mgit/appdata.rb, line 49
def self.latest
  sorted.last
end
sorted() click to toggle source
# File lib/mgit/appdata.rb, line 37
def self.sorted
  @versions.sort_by { |v| v.version }
end
updates() click to toggle source
# File lib/mgit/appdata.rb, line 41
def self.updates
  sorted.drop_while { |v| !v.active? }.drop(1)
end

Public Instance Methods

<=>(other) click to toggle source
# File lib/mgit/appdata.rb, line 55
def <=>(other)
  version <=> other.version
end