Sha256: 8012d086b543b959ed074adfb717694f5f99435ae271cd85f108c9eca97fc735

Contents?: true

Size: 867 Bytes

Versions: 6

Compression:

Stored size: 867 Bytes

Contents

require 'pact_broker/api/resources/base_resource'
require 'pact_broker/configuration'
require 'pact_broker/api/decorators/versions_decorator'

module PactBroker
  module Api
    module Resources
      class Versions < BaseResource
        def content_types_provided
          [["application/hal+json", :to_json]]
        end

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

        def resource_exists?
          !!pacticipant
        end

        def to_json
          PactBroker::Api::Decorators::VersionsDecorator.new(versions).to_json(user_options: decorator_context(identifier_from_path))
        end

        def versions
          @versions ||= pacticipant_service.find_all_pacticipant_versions_in_reverse_order pacticipant_name
        end

        def policy_name
          :'versions::versions'
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
pact_broker-2.65.0 lib/pact_broker/api/resources/versions.rb
pact_broker-2.64.0 lib/pact_broker/api/resources/versions.rb
pact_broker-2.63.0 lib/pact_broker/api/resources/versions.rb
pact_broker-2.62.0 lib/pact_broker/api/resources/versions.rb
pact_broker-2.61.0 lib/pact_broker/api/resources/versions.rb
pact_broker-2.60.1 lib/pact_broker/api/resources/versions.rb