Sha256: 257a66cbc0098f201e9f54b22474f36850d4c5dc7f891c77e3d6796b43759ceb

Contents?: true

Size: 853 Bytes

Versions: 50

Compression:

Stored size: 853 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(user_options: 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

50 entries across 50 versions & 1 rubygems

Version Path
pact_broker-2.18.0 lib/pact_broker/api/resources/latest_provider_pacts.rb
pact_broker-2.17.1 lib/pact_broker/api/resources/latest_provider_pacts.rb
pact_broker-2.17.0 lib/pact_broker/api/resources/latest_provider_pacts.rb
pact_broker-2.16.1 lib/pact_broker/api/resources/latest_provider_pacts.rb
pact_broker-2.16.0 lib/pact_broker/api/resources/latest_provider_pacts.rb
pact_broker-2.15.0 lib/pact_broker/api/resources/latest_provider_pacts.rb
pact_broker-2.14.0 lib/pact_broker/api/resources/latest_provider_pacts.rb
pact_broker-2.13.1 lib/pact_broker/api/resources/latest_provider_pacts.rb
pact_broker-2.13.0 lib/pact_broker/api/resources/latest_provider_pacts.rb
pact_broker-2.12.0 lib/pact_broker/api/resources/latest_provider_pacts.rb
pact_broker-2.11.0 lib/pact_broker/api/resources/latest_provider_pacts.rb
pact_broker-2.10.0 lib/pact_broker/api/resources/latest_provider_pacts.rb
pact_broker-2.9.0 lib/pact_broker/api/resources/latest_provider_pacts.rb
pact_broker-2.9.0.beta.5 lib/pact_broker/api/resources/latest_provider_pacts.rb
pact_broker-2.8.0.beta.5 lib/pact_broker/api/resources/latest_provider_pacts.rb
pact_broker-2.8.0.beta.4 lib/pact_broker/api/resources/latest_provider_pacts.rb
pact_broker-2.7.0.beta.3 lib/pact_broker/api/resources/latest_provider_pacts.rb
pact_broker-2.7.0.beta.2 lib/pact_broker/api/resources/latest_provider_pacts.rb
pact_broker-2.7.0.beta.1 lib/pact_broker/api/resources/latest_provider_pacts.rb
pact_broker-2.6.0 lib/pact_broker/api/resources/latest_provider_pacts.rb