Sha256: ca11ee7784a01454a2a80fb2e7cb74067b6a57a498d776214418fe1f8e5f5761

Contents?: true

Size: 1006 Bytes

Versions: 16

Compression:

Stored size: 1006 Bytes

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 :pacticipant do | context |
          {
            href: pacticipant_url(context[:base_url], OpenStruct.new(name: context[:pacticipant_name])),
            title: context[:pacticipant_name]
          }
        end

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

      end
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
pact_broker-2.4.2 lib/pact_broker/api/decorators/versions_decorator.rb
pact_broker-2.4.1 lib/pact_broker/api/decorators/versions_decorator.rb
pact_broker-2.4.0 lib/pact_broker/api/decorators/versions_decorator.rb
pact_broker-2.3.0 lib/pact_broker/api/decorators/versions_decorator.rb
pact_broker-2.2.0 lib/pact_broker/api/decorators/versions_decorator.rb
pact_broker-2.1.1 lib/pact_broker/api/decorators/versions_decorator.rb
pact_broker-2.1.0 lib/pact_broker/api/decorators/versions_decorator.rb
pact_broker-2.0.5 lib/pact_broker/api/decorators/versions_decorator.rb
pact_broker-2.0.4 lib/pact_broker/api/decorators/versions_decorator.rb
pact_broker-2.0.3 lib/pact_broker/api/decorators/versions_decorator.rb
pact_broker-2.0.2 lib/pact_broker/api/decorators/versions_decorator.rb
pact_broker-2.0.1 lib/pact_broker/api/decorators/versions_decorator.rb
pact_broker-2.0.0 lib/pact_broker/api/decorators/versions_decorator.rb
pact_broker-2.0.0.beta.8 lib/pact_broker/api/decorators/versions_decorator.rb
pact_broker-2.0.0.beta.7 lib/pact_broker/api/decorators/versions_decorator.rb
pact_broker-1.18.0 lib/pact_broker/api/decorators/versions_decorator.rb