class PactBroker::Api::Decorators::PactWebhooksStatusDecorator

Public Instance Methods

fake_consumer(context) click to toggle source
# File lib/pact_broker/api/decorators/pact_webhooks_status_decorator.rb, line 88
def fake_consumer context
  OpenStruct.new(name: context[:consumer_name])
end
fake_provider(context) click to toggle source
# File lib/pact_broker/api/decorators/pact_webhooks_status_decorator.rb, line 92
def fake_provider context
  OpenStruct.new(name: context[:provider_name])
end
pact() click to toggle source
# File lib/pact_broker/api/decorators/pact_webhooks_status_decorator.rb, line 84
def pact
  represented.any? ? represented.first.pact_publication : nil
end
summary() click to toggle source
# File lib/pact_broker/api/decorators/pact_webhooks_status_decorator.rb, line 73
def summary
  counts = represented.group_by(&:status).each_with_object({}) do | (status, triggered_webhooks), count |
    count[status] = triggered_webhooks.count
  end
  OpenStruct.new(counts)
end
triggered_webhooks_with_error_logs() click to toggle source
# File lib/pact_broker/api/decorators/pact_webhooks_status_decorator.rb, line 80
def triggered_webhooks_with_error_logs
  represented.select{|w| w.failure? || w.retrying? }
end