class PactBroker::Webhooks::Status
Attributes
rubocop: enable Metrics/CyclomaticComplexity
rubocop: enable Metrics/CyclomaticComplexity
Public Class Methods
Source
# File lib/pact_broker/webhooks/status.rb, line 5 def initialize _pact, webhooks, latest_triggered_webhooks @webhooks = webhooks @latest_triggered_webhooks = latest_triggered_webhooks end
Public Instance Methods
Source
# File lib/pact_broker/webhooks/status.rb, line 15 def to_sym return :none if webhooks.empty? return :not_run if latest_triggered_webhooks.empty? || latest_triggered_webhooks.all?{|w| w.status == "not_run"} if latest_triggered_webhooks.any?{|w| w.status == "retrying" } return :retrying end latest_triggered_webhooks.all?{|w| w.status == "success"} ? :success : :failure end
rubocop: disable Metrics/CyclomaticComplexity