Sha256: 7e9674b59d443d218b96832dcb481ebde7a40cff46cdccd9b6321e6545410cb7

Contents?: true

Size: 975 Bytes

Versions: 23

Compression:

Stored size: 975 Bytes

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
          PactBroker::Api::Decorators::IntegrationsDecorator.new(integrations).to_json(user_options: decorator_context)
        end

        def integrations
          integration_service.find_all
        end

        def delete_resource
          integration_service.delete_all
          true
        end
      end
    end
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
pact_broker-2.58.3 lib/pact_broker/api/resources/integrations.rb
pact_broker-2.58.2 lib/pact_broker/api/resources/integrations.rb
pact_broker-2.58.0 lib/pact_broker/api/resources/integrations.rb
pact_broker-2.57.0 lib/pact_broker/api/resources/integrations.rb
pact_broker-2.56.1 lib/pact_broker/api/resources/integrations.rb
pact_broker-2.56.0 lib/pact_broker/api/resources/integrations.rb
pact_broker-2.55.0 lib/pact_broker/api/resources/integrations.rb
pact_broker-2.54.0 lib/pact_broker/api/resources/integrations.rb
pact_broker-2.53.0 lib/pact_broker/api/resources/integrations.rb
pact_broker-2.52.2 lib/pact_broker/api/resources/integrations.rb
pact_broker-2.52.1 lib/pact_broker/api/resources/integrations.rb
pact_broker-2.52.0 lib/pact_broker/api/resources/integrations.rb
pact_broker-2.51.0 lib/pact_broker/api/resources/integrations.rb
pact_broker-2.50.1 lib/pact_broker/api/resources/integrations.rb
pact_broker-2.50.0 lib/pact_broker/api/resources/integrations.rb
pact_broker-2.49.0 lib/pact_broker/api/resources/integrations.rb
pact_broker-2.48.0 lib/pact_broker/api/resources/integrations.rb
pact_broker-2.47.1 lib/pact_broker/api/resources/integrations.rb
pact_broker-2.47.0 lib/pact_broker/api/resources/integrations.rb
pact_broker-2.46.0 lib/pact_broker/api/resources/integrations.rb