Class: PactBroker::Models::Webhook
- Inherits:
-
Object
- Object
- PactBroker::Models::Webhook
- Includes:
- Logging, PactBroker::Messages
- Defined in:
- lib/pact_broker/models/webhook.rb
Constant Summary
Constants included from Logging
Logging::LOG_DIR, Logging::LOG_FILE_NAME
Instance Attribute Summary collapse
-
#consumer ⇒ Object
Returns the value of attribute consumer.
-
#created_at ⇒ Object
Returns the value of attribute created_at.
-
#provider ⇒ Object
Returns the value of attribute provider.
-
#request ⇒ Object
Returns the value of attribute request.
-
#updated_at ⇒ Object
Returns the value of attribute updated_at.
-
#uuid ⇒ Object
Returns the value of attribute uuid.
Instance Method Summary collapse
- #consumer_name ⇒ Object
- #description ⇒ Object
-
#execute ⇒ Object
TODO retries.
-
#initialize(attributes = {}) ⇒ Webhook
constructor
A new instance of Webhook.
- #provider_name ⇒ Object
- #request_description ⇒ Object
- #to_s ⇒ Object
Methods included from Logging
Methods included from PactBroker::Messages
#message, #potential_duplicate_pacticipant_message, #validation_message
Constructor Details
#initialize(attributes = {}) ⇒ Webhook
Returns a new instance of Webhook.
17 18 19 20 21 22 23 24 |
# File 'lib/pact_broker/models/webhook.rb', line 17 def initialize attributes = {} @uuid = attributes[:uuid] @request = attributes[:request] @consumer = attributes[:consumer] @provider = attributes[:provider] @created_at = attributes[:created_at] @updated_at = attributes[:updated_at] end |
Instance Attribute Details
#consumer ⇒ Object
Returns the value of attribute consumer.
15 16 17 |
# File 'lib/pact_broker/models/webhook.rb', line 15 def consumer @consumer end |
#created_at ⇒ Object
Returns the value of attribute created_at.
15 16 17 |
# File 'lib/pact_broker/models/webhook.rb', line 15 def created_at @created_at end |
#provider ⇒ Object
Returns the value of attribute provider.
15 16 17 |
# File 'lib/pact_broker/models/webhook.rb', line 15 def provider @provider end |
#request ⇒ Object
Returns the value of attribute request.
15 16 17 |
# File 'lib/pact_broker/models/webhook.rb', line 15 def request @request end |
#updated_at ⇒ Object
Returns the value of attribute updated_at.
15 16 17 |
# File 'lib/pact_broker/models/webhook.rb', line 15 def updated_at @updated_at end |
#uuid ⇒ Object
Returns the value of attribute uuid.
15 16 17 |
# File 'lib/pact_broker/models/webhook.rb', line 15 def uuid @uuid end |
Instance Method Details
#consumer_name ⇒ Object
44 45 46 |
# File 'lib/pact_broker/models/webhook.rb', line 44 def consumer_name consumer && consumer.name end |
#description ⇒ Object
26 27 28 |
# File 'lib/pact_broker/models/webhook.rb', line 26 def description "A webhook for the pact between #{consumer.name} and #{provider.name}" end |
#execute ⇒ Object
TODO retries
35 36 37 38 |
# File 'lib/pact_broker/models/webhook.rb', line 35 def execute logger.info "Executing #{self}" request.execute end |
#provider_name ⇒ Object
48 49 50 |
# File 'lib/pact_broker/models/webhook.rb', line 48 def provider_name provider && provider.name end |
#request_description ⇒ Object
30 31 32 |
# File 'lib/pact_broker/models/webhook.rb', line 30 def request_description request && request.description end |
#to_s ⇒ Object
40 41 42 |
# File 'lib/pact_broker/models/webhook.rb', line 40 def to_s "webhook for consumer=#{consumer_name} provider=#{provider_name} uuid=#{uuid} request=#{request}" end |