Sha256: 82b1b0c04904a6359c17c5b32168de997f4b131ee58df9f5bc7ea262afe20ded

Contents?: true

Size: 688 Bytes

Versions: 25

Compression:

Stored size: 688 Bytes

Contents

require 'ostruct'

# TODO remove this class

module PactBroker
  module Api
    module Decorators
      class RepresentablePact

        attr_reader :consumer, :provider, :consumer_version, :consumer_version_number, :created_at, :updated_at

        def initialize pact
          @consumer_version = pact.consumer_version
          @consumer_version_number = pact.consumer_version.number
          @consumer = OpenStruct.new(:version => @consumer_version, :name => pact.consumer.name)
          @provider = OpenStruct.new(:version => nil, :name => pact.provider.name)
          @created_at = pact.created_at
          @updated_at = pact.updated_at
        end

      end
    end
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
pact_broker-1.8.0 lib/pact_broker/api/decorators/representable_pact.rb
pact_broker-1.7.0 lib/pact_broker/api/decorators/representable_pact.rb
pact_broker-1.6.0 lib/pact_broker/api/decorators/representable_pact.rb
pact_broker-1.5.0 lib/pact_broker/api/decorators/representable_pact.rb
pact_broker-1.4.0 lib/pact_broker/api/decorators/representable_pact.rb