Sha256: c6f09019a534fed0a94d84d8c16cbcdd4fe2ecc6a6cc7c9ec27b0cdd9b5c11c9

Contents?: true

Size: 612 Bytes

Versions: 9

Compression:

Stored size: 612 Bytes

Contents

class Library

  attr_accessor :name
  attr_accessor :manifests

  def versions
    versions = release_manifests.map { |m| m.version }
  end
  
  def generic_manifest
    @manifests.each do |m|
      if m.is_a?(ManifestGeneric)
        return m
      end
    end
    nil
  end

  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
  
  def latest_manifest
    if release_manifests.empty?
      return generic_manifest
    else
      return release_manifests.last
    end
  end

end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
inqlude-0.12.0 lib/library.rb
inqlude-0.11.0 lib/library.rb
inqlude-0.10.0 lib/library.rb
inqlude-0.9.0 lib/library.rb
inqlude-0.8.0 lib/library.rb
inqlude-0.7.4 lib/library.rb
inqlude-0.7.3 lib/library.rb
inqlude-0.7.2 lib/library.rb
inqlude-0.7.1 lib/library.rb