Sha256: 5aff495c987c35aee95c5aab594228ecec3c91fa29e9367cc902fbcbaf707f9a

Contents?: true

Size: 1010 Bytes

Versions: 12

Compression:

Stored size: 1010 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 versions of the pacticipant #{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

12 entries across 12 versions & 1 rubygems

Version Path
pact_broker-2.0.0.beta.6 lib/pact_broker/api/decorators/versions_decorator.rb
pact_broker-2.0.0.beta.5 lib/pact_broker/api/decorators/versions_decorator.rb
pact_broker-1.18.0.beta.1 lib/pact_broker/api/decorators/versions_decorator.rb
pact_broker-1.17.2 lib/pact_broker/api/decorators/versions_decorator.rb
pact_broker-1.17.1 lib/pact_broker/api/decorators/versions_decorator.rb
pact_broker-2.0.0.beta.4 lib/pact_broker/api/decorators/versions_decorator.rb
pact_broker-2.0.0.beta.3 lib/pact_broker/api/decorators/versions_decorator.rb
pact_broker-2.0.0.beta.2 lib/pact_broker/api/decorators/versions_decorator.rb
pact_broker-2.0.0.beta.1 lib/pact_broker/api/decorators/versions_decorator.rb
pact_broker-1.17.0 lib/pact_broker/api/decorators/versions_decorator.rb
pact_broker-1.16.0 lib/pact_broker/api/decorators/versions_decorator.rb
pact_broker-1.15.0 lib/pact_broker/api/decorators/versions_decorator.rb