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
- #resource_exists? ⇒ Boolean
- #resource_object ⇒ Object
- #to_text ⇒ Object
- #triggered_webhook ⇒ Object
Instance Method Details
#allowed_methods ⇒ Object
14 15 16 |
# File 'lib/pact_broker/api/resources/triggered_webhook_logs.rb', line 14 def allowed_methods ["GET", "OPTIONS"] end |
#content_types_provided ⇒ Object
10 11 12 |
# File 'lib/pact_broker/api/resources/triggered_webhook_logs.rb', line 10 def content_types_provided [["text/plain", :to_text]] end |
#resource_exists? ⇒ Boolean
18 19 20 |
# File 'lib/pact_broker/api/resources/triggered_webhook_logs.rb', line 18 def resource_exists? !!resource_object end |
#resource_object ⇒ Object
22 23 24 |
# File 'lib/pact_broker/api/resources/triggered_webhook_logs.rb', line 22 def resource_object triggered_webhook end |
#to_text ⇒ Object
26 27 28 29 |
# File 'lib/pact_broker/api/resources/triggered_webhook_logs.rb', line 26 def to_text # Too simple to bother putting into a service triggered_webhook.webhook_executions.collect(&:logs).join("\n") end |
#triggered_webhook ⇒ Object
31 32 33 34 35 36 |
# File 'lib/pact_broker/api/resources/triggered_webhook_logs.rb', line 31 def triggered_webhook @triggered_webhook ||= begin criteria = { webhook_uuid: identifier_from_path[:uuid], trigger_uuid: identifier_from_path[:trigger_uuid] } PactBroker::Webhooks::TriggeredWebhook.where(criteria).single_record end end |