class Honeybadger::Backend::Base

Attributes

config[R]

Public Class Methods

new(config) click to toggle source
# File lib/honeybadger/backend/base.rb, line 76
def initialize(config)
  @config = config
end

Public Instance Methods

check_in(id) click to toggle source

Does a check in using the input id.

@param [String] id The unique check_in id.

@raise NotImplementedError

# File lib/honeybadger/backend/base.rb, line 99
def check_in(id)
  raise NotImplementedError, 'must define #check_in on subclass.'
end
event(payload) click to toggle source

Send event @example backend.event([{event_type: “email_received”, ts: “2023-03-04T12:12:00+1:00”, subject: ‘Re: Aquisition’ }})

@param [Array] payload array of event hashes to send @raise NotImplementedError

# File lib/honeybadger/backend/base.rb, line 118
def event(payload)
  raise NotImplementedError, "must define #event on subclass"
end
notify(feature, payload) click to toggle source

Process payload for feature.

@example backend.notify(:notices, Notice.new(...))

@param [Symbol] feature The feature name (corresponds to HTTP endpoint). Current options are: ‘:notices`, `:deploys`, `:ping`. @param [#to_json] payload The JSON payload to send.

@raise NotImplementedError

# File lib/honeybadger/backend/base.rb, line 90
def notify(feature, payload)
  raise NotImplementedError, 'must define #notify on subclass.'
end
track_deployment(payload) click to toggle source

Track a deployment @example backend.track_deployment({ revision: ‘be2ceb6’ })

@param [#to_json] payload The JSON payload containing all deployment data.

# File lib/honeybadger/backend/base.rb, line 108
def track_deployment(payload)
  notify(:deploys, payload)
end