Class: PactBroker::Webhooks::ExecutionConfiguration

Inherits:
Object
  • Object
show all
Defined in:
lib/pact_broker/webhooks/execution_configuration.rb

Instance Method Summary collapse

Constructor Details

#initialize(params = {}) ⇒ ExecutionConfiguration

Returns a new instance of ExecutionConfiguration.



8
9
10
# File 'lib/pact_broker/webhooks/execution_configuration.rb', line 8

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

Instance Method Details

#[](key) ⇒ Object



32
33
34
# File 'lib/pact_broker/webhooks/execution_configuration.rb', line 32

def [](key)
  params[key]
end

#to_hashObject



36
37
38
# File 'lib/pact_broker/webhooks/execution_configuration.rb', line 36

def to_hash
  params
end

#with_failure_log_message(value) ⇒ Object



24
25
26
# File 'lib/pact_broker/webhooks/execution_configuration.rb', line 24

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

#with_show_response(value) ⇒ Object



16
17
18
# File 'lib/pact_broker/webhooks/execution_configuration.rb', line 16

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

#with_success_log_message(value) ⇒ Object



20
21
22
# File 'lib/pact_broker/webhooks/execution_configuration.rb', line 20

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

#with_updated_attribute(new_attribute) ⇒ Object



12
13
14
# File 'lib/pact_broker/webhooks/execution_configuration.rb', line 12

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

#with_webhook_context(value) ⇒ Object



28
29
30
# File 'lib/pact_broker/webhooks/execution_configuration.rb', line 28

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