Sha256: 7fb88cbe9e8a8b1a35261934ab4a4a8718b7322e886760490b948d7f1e0c0799
Contents?: true
Size: 1.5 KB
Versions: 22
Compression:
Stored size: 1.5 KB
Contents
require_relative 'base_decorator' require 'pact_broker/api/pact_broker_urls' require 'pact_broker/pacts/build_verifiable_pact_notices' module PactBroker module Api module Decorators class VerifiablePactDecorator < BaseDecorator property :shortDescription, getter: -> (context) { PactBroker::Pacts::VerifiablePactMessages.new(context[:represented], nil).pact_version_short_description } nested :verificationProperties do include PactBroker::Api::PactBrokerUrls property :pending, if: ->(context) { context[:options][:user_options][:include_pending_status] } property :wip, if: -> (context) { context[:represented].wip } property :notices, getter: -> (context) { context[:decorator].notices(context[:options][:user_options]) } property :noteToDevelopers, getter: -> (_) { "Please print out the text from the 'notices' rather than using the inclusionReason and the pendingReason fields. These will be removed when this API moves out of beta."} def notices(user_options) pact_url = pact_version_url(represented, user_options[:base_url]) PactBroker::Pacts::BuildVerifiablePactNotices.call(represented, pact_url, include_pending_status: user_options[:include_pending_status]) end end link :self do | user_options | { href: pact_version_url(represented, user_options[:base_url]), name: represented.name } end end end end end
Version data entries
22 entries across 22 versions & 1 rubygems