Sha256: ace753f0ad3ddc4c168ae95adea91f81261bd851e79f981ea024f79e9be0388c

Contents?: true

Size: 1.07 KB

Versions: 20

Compression:

Stored size: 1.07 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 resource_exists?
          !!version
        end

        def policy_name
          :'matrix::can_i_deploy'
        end

        private

        def selectors
          @selectors ||= begin
            [
              PactBroker::Matrix::UnresolvedSelector.new(
                pacticipant_name: pacticipant_name,
                latest: true,
                tag: identifier_from_path[:tag]
              )
            ]
          end
        end

        def options
          @options ||= {
            latestby: "cvp",
            latest: true,
            tag: identifier_from_path[:to]
          }
        end

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

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
pact_broker-2.93.4 lib/pact_broker/api/resources/can_i_deploy_pacticipant_version.rb
pact_broker-2.93.3 lib/pact_broker/api/resources/can_i_deploy_pacticipant_version.rb
pact_broker-2.93.2 lib/pact_broker/api/resources/can_i_deploy_pacticipant_version.rb
pact_broker-2.93.1 lib/pact_broker/api/resources/can_i_deploy_pacticipant_version.rb
pact_broker-2.93.0 lib/pact_broker/api/resources/can_i_deploy_pacticipant_version.rb
pact_broker-2.92.0 lib/pact_broker/api/resources/can_i_deploy_pacticipant_version.rb
pact_broker-2.91.0 lib/pact_broker/api/resources/can_i_deploy_pacticipant_version.rb
pact_broker-2.90.0 lib/pact_broker/api/resources/can_i_deploy_pacticipant_version.rb
pact_broker-2.89.1 lib/pact_broker/api/resources/can_i_deploy_pacticipant_version.rb
pact_broker-2.89.0 lib/pact_broker/api/resources/can_i_deploy_pacticipant_version.rb
pact_broker-2.88.0 lib/pact_broker/api/resources/can_i_deploy_pacticipant_version.rb
pact_broker-2.87.0 lib/pact_broker/api/resources/can_i_deploy_pacticipant_version.rb
pact_broker-2.86.0 lib/pact_broker/api/resources/can_i_deploy_pacticipant_version.rb
pact_broker-2.85.1 lib/pact_broker/api/resources/can_i_deploy_pacticipant_version.rb
pact_broker-2.85.0 lib/pact_broker/api/resources/can_i_deploy_pacticipant_version.rb
pact_broker-2.84.0 lib/pact_broker/api/resources/can_i_deploy_pacticipant_version.rb
pact_broker-2.83.0 lib/pact_broker/api/resources/can_i_deploy_pacticipant_version.rb
pact_broker-2.82.0 lib/pact_broker/api/resources/can_i_deploy_pacticipant_version.rb
pact_broker-2.81.0 lib/pact_broker/api/resources/can_i_deploy_pacticipant_version.rb
pact_broker-2.80.0 lib/pact_broker/api/resources/can_i_deploy_pacticipant_version.rb