Sha256: 384cdf4b4a59b2eeaf43037c2ad87f33fd06b12d1e328895019c6d0f0c3ca4cc

Contents?: true

Size: 839 Bytes

Versions: 14

Compression:

Stored size: 839 Bytes

Contents

require 'pact_broker/api/resources/base_resource'
require 'pact_broker/configuration'
require 'pact_broker/api/decorators/provider_pacts_decorator'

module PactBroker
  module Api
    module Resources

      class LatestProviderPacts < BaseResource

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

        def allowed_methods
          ["GET"]
        end

        def resource_exists?
          pacticipant_service.find_pacticipant_by_name(provider_name)
        end

        def to_json
          PactBroker::Api::Decorators::ProviderPactsDecorator.new(pacts).to_json(decorator_context(identifier_from_path))
        end

        def pacts
          pact_service.find_latest_pact_versions_for_provider provider_name, tag: identifier_from_path[:tag]
        end

      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
pact_broker-1.14.0 lib/pact_broker/api/resources/latest_provider_pacts.rb
pact_broker-1.13.0 lib/pact_broker/api/resources/latest_provider_pacts.rb
pact_broker-1.12.0 lib/pact_broker/api/resources/latest_provider_pacts.rb
pact_broker-1.11.2 lib/pact_broker/api/resources/latest_provider_pacts.rb
pact_broker-1.11.1 lib/pact_broker/api/resources/latest_provider_pacts.rb
pact_broker-1.11.0 lib/pact_broker/api/resources/latest_provider_pacts.rb
pact_broker-1.10.0 lib/pact_broker/api/resources/latest_provider_pacts.rb
pact_broker-1.9.3 lib/pact_broker/api/resources/latest_provider_pacts.rb
pact_broker-1.9.2 lib/pact_broker/api/resources/latest_provider_pacts.rb
pact_broker-1.9.1 lib/pact_broker/api/resources/latest_provider_pacts.rb
pact_broker-1.9.0 lib/pact_broker/api/resources/latest_provider_pacts.rb
pact_broker-1.9.0.rc1 lib/pact_broker/api/resources/latest_provider_pacts.rb
pact_broker-1.8.1 lib/pact_broker/api/resources/latest_provider_pacts.rb
pact_broker-1.8.0 lib/pact_broker/api/resources/latest_provider_pacts.rb