Class: MGit::AppData::AppDataVersion
- Inherits:
-
Object
- Object
- MGit::AppData::AppDataVersion
show all
- Includes:
- Comparable
- Defined in:
- lib/mgit/appdata.rb
Overview
Base class for data storage versions. #
Constant Summary
collapse
- @@versions =
[]
Class Method Summary
collapse
Instance Method Summary
collapse
Class Method Details
.active ⇒ Object
47
48
49
|
# File 'lib/mgit/appdata.rb', line 47
def self.active
self.sorted.find { |v| v.active? }
end
|
.inherited(version) ⇒ Object
34
35
36
37
|
# File 'lib/mgit/appdata.rb', line 34
def self.inherited(version)
@@versions << version.new
super
end
|
.latest ⇒ Object
51
52
53
|
# File 'lib/mgit/appdata.rb', line 51
def self.latest
self.sorted.last
end
|
.sorted ⇒ Object
39
40
41
|
# File 'lib/mgit/appdata.rb', line 39
def self.sorted
@@versions.sort_by { |v| v.version }
end
|
.updates ⇒ Object
43
44
45
|
# File 'lib/mgit/appdata.rb', line 43
def self.updates
self.sorted.drop_while { |v| !v.active? }.drop(1)
end
|
Instance Method Details
#<=>(other) ⇒ Object
57
58
59
|
# File 'lib/mgit/appdata.rb', line 57
def <=>(other)
version <=> other.version
end
|