Sha256: c88b5fce1322b396d3df8d8ad03a2f89bb801b1dc5997b99237deb5ca5b57744

Contents?: true

Size: 907 Bytes

Versions: 1

Compression:

Stored size: 907 Bytes

Contents

require_relative 'base_decorator'
require_relative 'pact_pacticipant_decorator'

module PactBroker

  module Api

    module Decorators

      class EmbeddedVersionDecorator < BaseDecorator

        property :number

        link :self do | options |
          version_url(options[:base_url], represented)
        end
      end

      class PactVersionDecorator < BaseDecorator


        property :createdAt, getter: lambda { |_|  created_at.to_time.localtime.xmlschema }, writeable: false
        property :updatedAt, getter: lambda { |_| updated_at.to_time.localtime.xmlschema }, writeable: false

        property :consumer_version, as: :consumerVersion, embedded: true, decorator: EmbeddedVersionDecorator


        link :self do | options |
          {
            href: pact_url(options.base_url, represented),
            title: represented.name
          }

        end

      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
pact_broker-1.2.0 lib/pact_broker/api/decorators/pact_version_decorator.rb