Class: Library
- Inherits:
-
Object
- Object
- Library
- Defined in:
- lib/library.rb
Instance Attribute Summary collapse
-
#manifests ⇒ Object
Returns the value of attribute manifests.
-
#name ⇒ Object
Returns the value of attribute name.
Instance Method Summary collapse
Instance Attribute Details
#manifests ⇒ Object
Returns the value of attribute manifests.
4 5 6 |
# File 'lib/library.rb', line 4 def manifests @manifests end |
#name ⇒ Object
Returns the value of attribute name.
3 4 5 |
# File 'lib/library.rb', line 3 def name @name end |
Instance Method Details
#generic_manifest ⇒ Object
10 11 12 13 14 15 16 17 |
# File 'lib/library.rb', line 10 def generic_manifest @manifests.each do |m| if m.is_a?(ManifestGeneric) return m end end nil end |
#latest_manifest ⇒ Object
27 28 29 30 31 32 33 |
# File 'lib/library.rb', line 27 def latest_manifest if release_manifests.empty? return generic_manifest else return release_manifests.last end end |
#release_manifests ⇒ Object
19 20 21 22 23 24 25 |
# File 'lib/library.rb', line 19 def release_manifests result = @manifests.reject { |m| m.is_a?(ManifestGeneric) } result.sort! do |m1,m2| m1.release_date <=> m2.release_date end result end |
#versions ⇒ Object
6 7 8 |
# File 'lib/library.rb', line 6 def versions versions = release_manifests.map { |m| m.version } end |