Class: PactBroker::Api::Resources::TriggeredWebhookLogs
- Inherits:
-
BaseResource
- Object
- PactBroker::Api::Resources::TriggeredWebhookLogs
- Defined in:
- lib/pact_broker/api/resources/triggered_webhook_logs.rb
Instance Method Summary collapse
- #allowed_methods ⇒ Object
- #content_types_provided ⇒ Object
- #policy_name ⇒ Object
- #policy_record ⇒ Object
- #resource_exists? ⇒ Boolean
- #to_text ⇒ Object
Instance Method Details
#allowed_methods ⇒ Object
13 14 15 |
# File 'lib/pact_broker/api/resources/triggered_webhook_logs.rb', line 13 def allowed_methods ["GET", "OPTIONS"] end |
#content_types_provided ⇒ Object
9 10 11 |
# File 'lib/pact_broker/api/resources/triggered_webhook_logs.rb', line 9 def content_types_provided [["text/plain", :to_text]] end |
#policy_name ⇒ Object
30 31 32 |
# File 'lib/pact_broker/api/resources/triggered_webhook_logs.rb', line 30 def policy_name :'webhooks::webhook' end |
#policy_record ⇒ Object
34 35 36 |
# File 'lib/pact_broker/api/resources/triggered_webhook_logs.rb', line 34 def policy_record triggered_webhook&.webhook end |
#resource_exists? ⇒ Boolean
17 18 19 |
# File 'lib/pact_broker/api/resources/triggered_webhook_logs.rb', line 17 def resource_exists? !!triggered_webhook end |
#to_text ⇒ Object
21 22 23 24 25 26 27 28 |
# File 'lib/pact_broker/api/resources/triggered_webhook_logs.rb', line 21 def to_text # Too simple to bother putting into a service if webhook_executions.any? webhook_executions.collect(&:logs).join("\n") else "Webhook has not executed yet. Please retry in a few seconds." end end |