class ExceptionNotifier::DatadogNotifier

Attributes

client[R]
default_options[R]

Public Class Methods

new(options) click to toggle source
Calls superclass method ExceptionNotifier::BaseNotifier::new
# File lib/exception_notifier/datadog_notifier.rb, line 10
def initialize(options)
  super
  @client = options.fetch(:client)
  @default_options = options
end

Public Instance Methods

call(exception, options = {}) click to toggle source
# File lib/exception_notifier/datadog_notifier.rb, line 16
def call(exception, options = {})
  client.emit_event(
    datadog_event(exception, options)
  )
end
datadog_event(exception, options = {}) click to toggle source
# File lib/exception_notifier/datadog_notifier.rb, line 22
def datadog_event(exception, options = {})
  DatadogExceptionEvent.new(
    exception,
    options.reverse_merge(default_options)
  ).event
end