Sha256: b77c7de857237508dfd33728744cb942f015b23bc4e5655aa04acdbf7046110e

Contents?: true

Size: 1.22 KB

Versions: 57

Compression:

Stored size: 1.22 KB

Contents

require_relative 'base_decorator'
require 'pact_broker/api/pact_broker_urls'

module PactBroker
  module Api
    module Decorators
      class IntegrationDecorator < BaseDecorator
        include PactBroker::Api::PactBrokerUrls

        property :consumer do
          property :name
        end

        property :provider do
          property :name
        end

        property :verificationStatus, getter: ->(represented:, **) { represented.verification_status_for_latest_pact.to_s }

        link "pb:dashboard" do | options |
          {
            title: "BETA: Pacts to show on the dashboard",
            href: dashboard_url_for_integration(represented.consumer.name, represented.provider.name, options.fetch(:base_url))
          }
        end

        link "pb:matrix" do | options |
          {
            title: "Matrix of pacts/verification results for #{represented.consumer.name} and #{represented.provider.name}",
            href: matrix_url(represented.consumer.name, represented.provider.name, options.fetch(:base_url))
          }
        end

        link "pb:group" do | options |
          {
            href: group_url(represented.consumer.name, options.fetch(:base_url))
          }
        end
      end
    end
  end
end

Version data entries

57 entries across 57 versions & 1 rubygems

Version Path
pact_broker-2.79.1 lib/pact_broker/api/decorators/integration_decorator.rb
pact_broker-2.79.0 lib/pact_broker/api/decorators/integration_decorator.rb
pact_broker-2.78.1 lib/pact_broker/api/decorators/integration_decorator.rb
pact_broker-2.78.0 lib/pact_broker/api/decorators/integration_decorator.rb
pact_broker-2.77.0 lib/pact_broker/api/decorators/integration_decorator.rb
pact_broker-2.76.2 lib/pact_broker/api/decorators/integration_decorator.rb
pact_broker-2.76.1 lib/pact_broker/api/decorators/integration_decorator.rb
pact_broker-2.76.0 lib/pact_broker/api/decorators/integration_decorator.rb
pact_broker-2.75.0 lib/pact_broker/api/decorators/integration_decorator.rb
pact_broker-2.74.1 lib/pact_broker/api/decorators/integration_decorator.rb
pact_broker-2.74.0 lib/pact_broker/api/decorators/integration_decorator.rb
pact_broker-2.73.0 lib/pact_broker/api/decorators/integration_decorator.rb
pact_broker-2.72.0 lib/pact_broker/api/decorators/integration_decorator.rb
pact_broker-2.71.0 lib/pact_broker/api/decorators/integration_decorator.rb
pact_broker-2.70.0 lib/pact_broker/api/decorators/integration_decorator.rb
pact_broker-2.69.0 lib/pact_broker/api/decorators/integration_decorator.rb
pact_broker-2.68.1 lib/pact_broker/api/decorators/integration_decorator.rb
pact_broker-2.68.0 lib/pact_broker/api/decorators/integration_decorator.rb
pact_broker-2.67.0 lib/pact_broker/api/decorators/integration_decorator.rb
pact_broker-2.66.0 lib/pact_broker/api/decorators/integration_decorator.rb