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. #
Class Method Summary
collapse
Instance Method Summary
collapse
Class Method Details
.active ⇒ Object
45
46
47
|
# File 'lib/mgit/appdata.rb', line 45
def self.active
sorted.find { |v| v.active? }
end
|
.inherited(version) ⇒ Object
31
32
33
34
35
|
# File 'lib/mgit/appdata.rb', line 31
def self.inherited(version)
@versions ||= []
@versions << version.new
super
end
|
.latest ⇒ Object
49
50
51
|
# File 'lib/mgit/appdata.rb', line 49
def self.latest
sorted.last
end
|
.sorted ⇒ Object
37
38
39
|
# File 'lib/mgit/appdata.rb', line 37
def self.sorted
@versions.sort_by { |v| v.version }
end
|
.updates ⇒ Object
41
42
43
|
# File 'lib/mgit/appdata.rb', line 41
def self.updates
sorted.drop_while { |v| !v.active? }.drop(1)
end
|
Instance Method Details
#<=>(other) ⇒ Object
55
56
57
|
# File 'lib/mgit/appdata.rb', line 55
def <=>(other)
version <=> other.version
end
|