Sha256: fb2e7266d3fadd5ca113270d3c272e083cf54fd894f9d0dc9aec1e8d24654431

Contents?: true

Size: 572 Bytes

Versions: 8

Compression:

Stored size: 572 Bytes

Contents

module VersionCake
  class VersionContext
    attr_reader :resource, :result
    attr_accessor :version

    def initialize(version, resource, result)
      @version, @resource, @result = version, resource, result
    end

    # A boolean check to determine if the latest version is requested.
    def is_latest_version?
      @version == @resource.latest_version
    end

    # Ordered versions that are equal to or lower
    # than the requested version.
    def available_versions
      @resource.available_versions.reverse.reject { |v| v > @version }
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
versioncake-4.1.1 lib/versioncake/version_context.rb
versioncake-4.1.0 lib/versioncake/version_context.rb
versioncake-4.0.2 lib/versioncake/version_context.rb
versioncake-4.0.1 lib/versioncake/version_context.rb
versioncake-4.0.0 lib/versioncake/version_context.rb
versioncake-3.4.0 lib/versioncake/version_context.rb
versioncake-3.3.0 lib/versioncake/version_context.rb
versioncake-3.2.0 lib/versioncake/version_context.rb