Sha256: 07e42831659cd0bc406e8dc4d412d97147b98fc7a1d89031fb27bd58a2a643aa

Contents?: true

Size: 1.48 KB

Versions: 92

Compression:

Stored size: 1.48 KB

Contents

require_relative 'base_decorator'
require_relative 'version_decorator'

module PactBroker
  module Api
    module Decorators
      class VersionsDecorator < BaseDecorator

        collection :entries, as: :versions, embedded: true, :extend => PactBroker::Api::Decorators::VersionDecorator

        link :self do | context |
          {
            href: context[:resource_url],
            title: "All application versions of #{context[:pacticipant_name]}"
          }
        end

        link :'pb:pacticipant' do | context |
          {
            href: pacticipant_url(context[:base_url], OpenStruct.new(name: context[:pacticipant_name])),
            title: context[:pacticipant_name]
          }
        end

        links :'pb:versions' do | context |
          represented.collect do | version |
            {
              :href => version_url(context[:base_url], version),
              :title => version.version_and_updated_date
            }
          end
        end

        link :pacticipant do | context |
          {
            href: pacticipant_url(context[:base_url], OpenStruct.new(name: context[:pacticipant_name])),
            title: 'Deprecated - please use pb:pacticipant'
          }
        end

        links :'versions' do | context |
          represented.collect do | version |
            {
              :href => version_url(context[:base_url], version),
              :title => 'Deprecated - please use pb:versions'
            }
          end
        end
      end
    end
  end
end

Version data entries

92 entries across 92 versions & 1 rubygems

Version Path
pact_broker-2.65.0 lib/pact_broker/api/decorators/versions_decorator.rb
pact_broker-2.64.0 lib/pact_broker/api/decorators/versions_decorator.rb
pact_broker-2.63.0 lib/pact_broker/api/decorators/versions_decorator.rb
pact_broker-2.62.0 lib/pact_broker/api/decorators/versions_decorator.rb
pact_broker-2.61.0 lib/pact_broker/api/decorators/versions_decorator.rb
pact_broker-2.60.1 lib/pact_broker/api/decorators/versions_decorator.rb
pact_broker-2.60.0 lib/pact_broker/api/decorators/versions_decorator.rb
pact_broker-2.59.2 lib/pact_broker/api/decorators/versions_decorator.rb
pact_broker-2.59.1 lib/pact_broker/api/decorators/versions_decorator.rb
pact_broker-2.59.0 lib/pact_broker/api/decorators/versions_decorator.rb
pact_broker-2.58.3 lib/pact_broker/api/decorators/versions_decorator.rb
pact_broker-2.58.2 lib/pact_broker/api/decorators/versions_decorator.rb
pact_broker-2.58.0 lib/pact_broker/api/decorators/versions_decorator.rb
pact_broker-2.57.0 lib/pact_broker/api/decorators/versions_decorator.rb
pact_broker-2.56.1 lib/pact_broker/api/decorators/versions_decorator.rb
pact_broker-2.56.0 lib/pact_broker/api/decorators/versions_decorator.rb
pact_broker-2.55.0 lib/pact_broker/api/decorators/versions_decorator.rb
pact_broker-2.54.0 lib/pact_broker/api/decorators/versions_decorator.rb
pact_broker-2.53.0 lib/pact_broker/api/decorators/versions_decorator.rb
pact_broker-2.52.2 lib/pact_broker/api/decorators/versions_decorator.rb