Sha256: 6e574cf46c7b885c7abf84b49be34d1f8b44fb036c5c1f301e95a3ebd05fbe10

Contents?: true

Size: 1.05 KB

Versions: 22

Compression:

Stored size: 1.05 KB

Contents

require 'pact_broker/api/resources/matrix'
require 'pact_broker/matrix/can_i_deploy_query_schema'
require 'pact_broker/matrix/parse_can_i_deploy_query'

module PactBroker
  module Api
    module Resources
      class CanIDeployPacticipantVersion < Matrix
        def initialize
          super
          selector = PactBroker::Matrix::UnresolvedSelector.new(pacticipant_name: pacticipant_name, latest: true, tag: identifier_from_path[:tag])
          @options = {
            latestby: 'cvp',
            latest: true,
            tag: identifier_from_path[:to]
          }
          @selectors = [selector]
        end

        def resource_exists?
          !!version
        end

        def policy_name
          :'matrix::can_i_deploy'
        end

        private

        def version
          @version ||= version_service.find_by_pacticipant_name_and_latest_tag(identifier_from_path[:pacticipant_name], identifier_from_path[:tag])
        end

        def results
          @results ||= matrix_service.find(selectors, options)
        end
      end
    end
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
pact_broker-2.79.1 lib/pact_broker/api/resources/can_i_deploy_pacticipant_version.rb
pact_broker-2.79.0 lib/pact_broker/api/resources/can_i_deploy_pacticipant_version.rb
pact_broker-2.78.1 lib/pact_broker/api/resources/can_i_deploy_pacticipant_version.rb
pact_broker-2.78.0 lib/pact_broker/api/resources/can_i_deploy_pacticipant_version.rb
pact_broker-2.77.0 lib/pact_broker/api/resources/can_i_deploy_pacticipant_version.rb
pact_broker-2.76.2 lib/pact_broker/api/resources/can_i_deploy_pacticipant_version.rb
pact_broker-2.76.1 lib/pact_broker/api/resources/can_i_deploy_pacticipant_version.rb
pact_broker-2.76.0 lib/pact_broker/api/resources/can_i_deploy_pacticipant_version.rb
pact_broker-2.75.0 lib/pact_broker/api/resources/can_i_deploy_pacticipant_version.rb
pact_broker-2.74.1 lib/pact_broker/api/resources/can_i_deploy_pacticipant_version.rb
pact_broker-2.74.0 lib/pact_broker/api/resources/can_i_deploy_pacticipant_version.rb
pact_broker-2.73.0 lib/pact_broker/api/resources/can_i_deploy_pacticipant_version.rb
pact_broker-2.72.0 lib/pact_broker/api/resources/can_i_deploy_pacticipant_version.rb
pact_broker-2.71.0 lib/pact_broker/api/resources/can_i_deploy_pacticipant_version.rb
pact_broker-2.70.0 lib/pact_broker/api/resources/can_i_deploy_pacticipant_version.rb
pact_broker-2.69.0 lib/pact_broker/api/resources/can_i_deploy_pacticipant_version.rb
pact_broker-2.68.1 lib/pact_broker/api/resources/can_i_deploy_pacticipant_version.rb
pact_broker-2.68.0 lib/pact_broker/api/resources/can_i_deploy_pacticipant_version.rb
pact_broker-2.67.0 lib/pact_broker/api/resources/can_i_deploy_pacticipant_version.rb
pact_broker-2.66.0 lib/pact_broker/api/resources/can_i_deploy_pacticipant_version.rb