Sha256: 5955abca8ed97a2f03f22f4162949a9c02d743b04390d03fb61d62eaa91dfab5

Contents?: true

Size: 790 Bytes

Versions: 24

Compression:

Stored size: 790 Bytes

Contents

require 'pact_broker/services'
require 'pact_broker/api/decorators/version_decorator'

module PactBroker
  module Api
    module Resources

      class Version < BaseResource

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

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

        def resource_exists?
          version
        end

        def to_json
          Decorators::VersionDecorator.new(version).to_json(user_options: {base_url: base_url})
        end

        def delete_resource
          version_service.delete version
          true
        end

        private

        def version
          @version ||= version_service.find_by_pacticipant_name_and_number path_info
        end

      end
    end

  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
pact_broker-2.11.0 lib/pact_broker/api/resources/version.rb
pact_broker-2.10.0 lib/pact_broker/api/resources/version.rb
pact_broker-2.9.0 lib/pact_broker/api/resources/version.rb
pact_broker-2.9.0.beta.5 lib/pact_broker/api/resources/version.rb
pact_broker-2.8.0.beta.5 lib/pact_broker/api/resources/version.rb
pact_broker-2.8.0.beta.4 lib/pact_broker/api/resources/version.rb
pact_broker-2.7.0.beta.3 lib/pact_broker/api/resources/version.rb
pact_broker-2.7.0.beta.2 lib/pact_broker/api/resources/version.rb
pact_broker-2.7.0.beta.1 lib/pact_broker/api/resources/version.rb
pact_broker-2.6.0 lib/pact_broker/api/resources/version.rb
pact_broker-2.5.1 lib/pact_broker/api/resources/version.rb
pact_broker-2.5.0 lib/pact_broker/api/resources/version.rb
pact_broker-2.4.2 lib/pact_broker/api/resources/version.rb
pact_broker-2.4.1 lib/pact_broker/api/resources/version.rb
pact_broker-2.4.0 lib/pact_broker/api/resources/version.rb
pact_broker-2.3.0 lib/pact_broker/api/resources/version.rb
pact_broker-2.2.0 lib/pact_broker/api/resources/version.rb
pact_broker-2.1.1 lib/pact_broker/api/resources/version.rb
pact_broker-2.1.0 lib/pact_broker/api/resources/version.rb
pact_broker-2.0.5 lib/pact_broker/api/resources/version.rb