Sha256: 1ac8fb06f2ba9169205a59389d87a7efb2d78dc1a4bb2c58c2b7ef96728c2d10
Contents?: true
Size: 1.09 KB
Versions: 16
Compression:
Stored size: 1.09 KB
Contents
require 'pact_broker/db' require 'pact_broker/json' module PactBroker module Domain class Pact attr_accessor :id, :provider, :consumer_version, :consumer, :created_at, :json_content, :consumer_version_number, :revision_number, :pact_version_sha def initialize attributes attributes.each_pair do | key, value | self.send(key.to_s + "=", value) end end def consumer_name consumer.name end def provider_name provider.name end def consumer consumer_version.pacticipant end def to_s "Pact: consumer=#{consumer.name} provider=#{provider.name}" end def to_json options = {} json_content end def name "Pact between #{consumer.name} (v#{consumer_version_number}) and #{provider.name}" end def version_and_updated_date "Version #{consumer_version_number} - #{created_at.to_time.localtime.strftime("%d/%m/%Y")}" end def content_hash JSON.parse(json_content, PACT_PARSING_OPTIONS) end end end end
Version data entries
16 entries across 16 versions & 1 rubygems