Sha256: 7e1ebbd1d0442b1b4b3246eaf83bf80585fd75cf3c8225149bae63833e9be5a4

Contents?: true

Size: 991 Bytes

Versions: 54

Compression:

Stored size: 991 Bytes

Contents

require 'pact_broker/hash_refinements'

module PactBroker
  module Webhooks
    class ExecutionConfiguration
      using PactBroker::HashRefinements

      def initialize(params = {})
        @params = params
      end

      def with_updated_attribute(new_attribute)
        ExecutionConfiguration.new(params.deep_merge(new_attribute))
      end

      def with_show_response(value)
        with_updated_attribute(logging_options: { show_response: value })
      end

      def with_success_log_message(value)
        with_updated_attribute(logging_options: { success_log_message: value })
      end

      def with_failure_log_message(value)
        with_updated_attribute(logging_options: { failure_log_message: value })
      end

      def with_webhook_context(value)
        with_updated_attribute(webhook_context: value)
      end

      def [](key)
        params[key]
      end

      def to_hash
        params
      end

      private

      attr_reader :params
    end
  end
end

Version data entries

54 entries across 54 versions & 1 rubygems

Version Path
pact_broker-2.74.1 lib/pact_broker/webhooks/execution_configuration.rb
pact_broker-2.74.0 lib/pact_broker/webhooks/execution_configuration.rb
pact_broker-2.73.0 lib/pact_broker/webhooks/execution_configuration.rb
pact_broker-2.72.0 lib/pact_broker/webhooks/execution_configuration.rb
pact_broker-2.71.0 lib/pact_broker/webhooks/execution_configuration.rb
pact_broker-2.70.0 lib/pact_broker/webhooks/execution_configuration.rb
pact_broker-2.69.0 lib/pact_broker/webhooks/execution_configuration.rb
pact_broker-2.68.1 lib/pact_broker/webhooks/execution_configuration.rb
pact_broker-2.68.0 lib/pact_broker/webhooks/execution_configuration.rb
pact_broker-2.67.0 lib/pact_broker/webhooks/execution_configuration.rb
pact_broker-2.66.0 lib/pact_broker/webhooks/execution_configuration.rb
pact_broker-2.65.0 lib/pact_broker/webhooks/execution_configuration.rb
pact_broker-2.64.0 lib/pact_broker/webhooks/execution_configuration.rb
pact_broker-2.63.0 lib/pact_broker/webhooks/execution_configuration.rb
pact_broker-2.62.0 lib/pact_broker/webhooks/execution_configuration.rb
pact_broker-2.61.0 lib/pact_broker/webhooks/execution_configuration.rb
pact_broker-2.60.1 lib/pact_broker/webhooks/execution_configuration.rb
pact_broker-2.60.0 lib/pact_broker/webhooks/execution_configuration.rb
pact_broker-2.59.2 lib/pact_broker/webhooks/execution_configuration.rb
pact_broker-2.59.1 lib/pact_broker/webhooks/execution_configuration.rb