Sha256: 3964d50f2ef2e6af95dddda52c151356b9c744540d4deb27b520a7117d40c9b5

Contents?: true

Size: 1.02 KB

Versions: 36

Compression:

Stored size: 1.02 KB

Contents

require "pact_broker/api/resources/base_resource"
require "pact_broker/api/renderers/integrations_dot_renderer"
require "pact_broker/api/decorators/integrations_decorator"

module PactBroker
  module Api
    module Resources
      class Integrations < BaseResource
        def content_types_provided
          [
            ["text/vnd.graphviz", :to_dot],
            ["application/hal+json", :to_json]
          ]
        end

        def allowed_methods
          ["GET", "OPTIONS", "DELETE"]
        end

        def to_dot
          PactBroker::Api::Renderers::IntegrationsDotRenderer.call(integrations)
        end

        def to_json
          decorator_class(:integrations_decorator).new(integrations).to_json(decorator_options)
        end

        def integrations
          @integrations ||= integration_service.find_all
        end

        def delete_resource
          integration_service.delete_all
          true
        end

        def policy_name
          :'integrations::integrations'
        end
      end
    end
  end
end

Version data entries

36 entries across 36 versions & 1 rubygems

Version Path
pact_broker-2.106.0 lib/pact_broker/api/resources/integrations.rb
pact_broker-2.105.0 lib/pact_broker/api/resources/integrations.rb
pact_broker-2.104.0 lib/pact_broker/api/resources/integrations.rb
pact_broker-2.103.0 lib/pact_broker/api/resources/integrations.rb
pact_broker-2.102.2 lib/pact_broker/api/resources/integrations.rb
pact_broker-2.102.1 lib/pact_broker/api/resources/integrations.rb
pact_broker-2.102.0 lib/pact_broker/api/resources/integrations.rb
pact_broker-2.101.0 lib/pact_broker/api/resources/integrations.rb
pact_broker-2.100.0 lib/pact_broker/api/resources/integrations.rb
pact_broker-2.99.0 lib/pact_broker/api/resources/integrations.rb
pact_broker-2.98.0 lib/pact_broker/api/resources/integrations.rb
pact_broker-2.97.0 lib/pact_broker/api/resources/integrations.rb
pact_broker-2.96.0 lib/pact_broker/api/resources/integrations.rb
pact_broker-2.95.1 lib/pact_broker/api/resources/integrations.rb
pact_broker-2.95.0 lib/pact_broker/api/resources/integrations.rb
pact_broker-2.94.0 lib/pact_broker/api/resources/integrations.rb
pact_broker-2.93.4 lib/pact_broker/api/resources/integrations.rb
pact_broker-2.93.3 lib/pact_broker/api/resources/integrations.rb
pact_broker-2.93.2 lib/pact_broker/api/resources/integrations.rb
pact_broker-2.93.1 lib/pact_broker/api/resources/integrations.rb