Sha256: 2d711678a2cc1f34e8c5f29f256dd303b3ac82287a010fc2803c5d1fa07db4d8

Contents?: true

Size: 984 Bytes

Versions: 64

Compression:

Stored size: 984 Bytes

Contents

require_relative 'base_decorator'
require_relative 'pact_version_decorator'

module PactBroker

  module Api

    module Decorators


      class ProviderPactsDecorator < BaseDecorator

        link :self do | context |
          suffix = context[:tag] ? " with tag '#{context[:tag]}'" : ""
          {
            href: context[:resource_url],
            title: "Latest pact versions for the provider #{context[:provider_name]}#{suffix}"
          }
        end

        link :provider do | context |
          {
            href: pacticipant_url(context[:base_url], OpenStruct.new(name: context[:provider_name])),
            title: context[:provider_name]
          }
        end

        links :'pacts' do | context |
          represented.collect do | pact |
            {
              :href => pact_url(context[:base_url], pact),
              :title => pact.name,
              :name => pact.consumer.name
            }
          end
        end

      end
    end
  end
end

Version data entries

64 entries across 64 versions & 1 rubygems

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