Sha256: 55923b48b58515a318878a528231bff4e000228447f38848b570e2fab48ed489

Contents?: true

Size: 827 Bytes

Versions: 34

Compression:

Stored size: 827 Bytes

Contents

require_relative 'base_decorator'
require 'pact_broker/api/decorators/webhook_decorator'

module PactBroker
  module Api
    module Decorators
      class WebhooksDecorator < BaseDecorator


        link :self do | context |
          {
            title: context[:resource_title],
            href: context[:resource_url]
          }
        end

        links :webhooks do | context |
          represented.entries.collect do | webhook |
            {
              title: webhook.description,
              name: webhook.request_description,
              href: webhook_url(webhook.uuid, context[:base_url])
            }
          end
        end

        curies do | context |
          [{
            name: :pb,
            href: context[:base_url] + '/doc/webhooks',
          }]
        end

      end
    end
  end
end

Version data entries

34 entries across 34 versions & 1 rubygems

Version Path
pact_broker-2.0.0 lib/pact_broker/api/decorators/webhooks_decorator.rb
pact_broker-2.0.0.beta.8 lib/pact_broker/api/decorators/webhooks_decorator.rb
pact_broker-2.0.0.beta.7 lib/pact_broker/api/decorators/webhooks_decorator.rb
pact_broker-2.0.0.beta.6 lib/pact_broker/api/decorators/webhooks_decorator.rb
pact_broker-1.18.0 lib/pact_broker/api/decorators/webhooks_decorator.rb
pact_broker-2.0.0.beta.5 lib/pact_broker/api/decorators/webhooks_decorator.rb
pact_broker-1.18.0.beta.1 lib/pact_broker/api/decorators/webhooks_decorator.rb
pact_broker-1.17.2 lib/pact_broker/api/decorators/webhooks_decorator.rb
pact_broker-1.17.1 lib/pact_broker/api/decorators/webhooks_decorator.rb
pact_broker-2.0.0.beta.4 lib/pact_broker/api/decorators/webhooks_decorator.rb
pact_broker-2.0.0.beta.3 lib/pact_broker/api/decorators/webhooks_decorator.rb
pact_broker-2.0.0.beta.2 lib/pact_broker/api/decorators/webhooks_decorator.rb
pact_broker-2.0.0.beta.1 lib/pact_broker/api/decorators/webhooks_decorator.rb
pact_broker-1.17.0 lib/pact_broker/api/decorators/webhooks_decorator.rb
pact_broker-1.16.0 lib/pact_broker/api/decorators/webhooks_decorator.rb
pact_broker-1.15.0 lib/pact_broker/api/decorators/webhooks_decorator.rb
pact_broker-1.14.0 lib/pact_broker/api/decorators/webhooks_decorator.rb
pact_broker-1.13.0 lib/pact_broker/api/decorators/webhooks_decorator.rb
pact_broker-1.12.0 lib/pact_broker/api/decorators/webhooks_decorator.rb
pact_broker-1.11.2 lib/pact_broker/api/decorators/webhooks_decorator.rb