Sha256: 4a79c30b69fdd097ba1a3130e9b018c847b8224d6ce5fa4943b6427d09507e2a

Contents?: true

Size: 1.06 KB

Versions: 35

Compression:

Stored size: 1.06 KB

Contents

require "pact_broker/api/resources/base_resource"
require "pact_broker/api/decorators/dashboard_decorator"
require "pact_broker/api/decorators/dashboard_text_decorator"
require "pact_broker/api/resources/pagination_methods"

module PactBroker
  module Api
    module Resources
      class Dashboard < BaseResource
        include PaginationMethods

        def content_types_provided
          [
            ["application/hal+json", :to_json],
            ["text/plain", :to_text],
          ]
        end

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

        def to_json
          decorator_class(:dashboard_decorator).new(index_items).to_json(decorator_options)
        end

        def to_text
          decorator_class(:dashboard_text_decorator).new(index_items).to_text(decorator_options)
        end

        def policy_name
          :'dashboard::dashboard'
        end

        private

        def index_items
          index_service.find_index_items_for_api(identifier_from_path.merge(pagination_options))
        end
      end
    end
  end
end

Version data entries

35 entries across 35 versions & 1 rubygems

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