Sha256: 024079010111fad836cb72de9b230c5b1b30aa0de3aaa3c1bf474664c044b192
Contents?: true
Size: 851 Bytes
Versions: 45
Compression:
Stored size: 851 Bytes
Contents
module PactBroker module Webhooks class Status def initialize _pact, webhooks, latest_triggered_webhooks @webhooks = webhooks @latest_triggered_webhooks = latest_triggered_webhooks end def to_s to_sym.to_s end # rubocop: disable Metrics/CyclomaticComplexity 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: enable Metrics/CyclomaticComplexity private attr_reader :webhooks, :latest_triggered_webhooks end end end
Version data entries
45 entries across 45 versions & 1 rubygems