Sha256: 7129e306ecb76c8cabc40fc36e9f276dd775a9e1e80a3129ea862b1712db85ce

Contents?: true

Size: 1.2 KB

Versions: 30

Compression:

Stored size: 1.2 KB

Contents

require 'pact_broker/api/resources/base_resource'
require 'pact_broker/configuration'
require 'pact_broker/domain/verification'
require 'pact_broker/api/contracts/verification_contract'
require 'pact_broker/api/decorators/verification_summary_decorator'

module PactBroker
  module Api
    module Resources
      class LatestVerificationsForConsumerVersion < BaseResource

        def allowed_methods
          ["GET", "OPTIONS"]
        end

        def content_types_provided
          [["application/hal+json", :to_json]]
        end

        def resource_exists?
          version_params = {pacticipant_name: identifier_from_path[:consumer_name], pacticipant_version_number: identifier_from_path[:consumer_version_number]}
          !!version_service.find_by_pacticipant_name_and_number(version_params)
        end

        def to_json
          summary = verification_service.verification_summary_for_consumer_version(identifier_from_path)
          decorator_for(summary).to_json(user_options: decorator_context(identifier_from_path))
        end

        private

        def decorator_for summary
          PactBroker::Api::Decorators::VerificationSummaryDecorator.new(summary)
        end
      end
    end
  end
end

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
pact_broker-2.58.0 lib/pact_broker/api/resources/latest_verifications_for_consumer_version.rb
pact_broker-2.57.0 lib/pact_broker/api/resources/latest_verifications_for_consumer_version.rb
pact_broker-2.56.1 lib/pact_broker/api/resources/latest_verifications_for_consumer_version.rb
pact_broker-2.56.0 lib/pact_broker/api/resources/latest_verifications_for_consumer_version.rb
pact_broker-2.55.0 lib/pact_broker/api/resources/latest_verifications_for_consumer_version.rb
pact_broker-2.54.0 lib/pact_broker/api/resources/latest_verifications_for_consumer_version.rb
pact_broker-2.53.0 lib/pact_broker/api/resources/latest_verifications_for_consumer_version.rb
pact_broker-2.52.2 lib/pact_broker/api/resources/latest_verifications_for_consumer_version.rb
pact_broker-2.52.1 lib/pact_broker/api/resources/latest_verifications_for_consumer_version.rb
pact_broker-2.52.0 lib/pact_broker/api/resources/latest_verifications_for_consumer_version.rb
pact_broker-2.51.0 lib/pact_broker/api/resources/latest_verifications_for_consumer_version.rb
pact_broker-2.50.1 lib/pact_broker/api/resources/latest_verifications_for_consumer_version.rb
pact_broker-2.50.0 lib/pact_broker/api/resources/latest_verifications_for_consumer_version.rb
pact_broker-2.49.0 lib/pact_broker/api/resources/latest_verifications_for_consumer_version.rb
pact_broker-2.48.0 lib/pact_broker/api/resources/latest_verifications_for_consumer_version.rb
pact_broker-2.47.1 lib/pact_broker/api/resources/latest_verifications_for_consumer_version.rb
pact_broker-2.47.0 lib/pact_broker/api/resources/latest_verifications_for_consumer_version.rb
pact_broker-2.46.0 lib/pact_broker/api/resources/latest_verifications_for_consumer_version.rb
pact_broker-2.45.0 lib/pact_broker/api/resources/latest_verifications_for_consumer_version.rb
pact_broker-2.44.0 lib/pact_broker/api/resources/latest_verifications_for_consumer_version.rb