Class: Honeybadger::Backend::Base Private

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Includes:
Logging::Helper
Defined in:
lib/honeybadger/backend/base.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

API:

  • private

Direct Known Subclasses

Null, Server

Instance Method Summary collapse

Constructor Details

#initialize(config) ⇒ Base

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of Base.

API:

  • private



77
78
79
# File 'lib/honeybadger/backend/base.rb', line 77

def initialize(config)
  @config = config
end

Instance Method Details

#check_in(id) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Does a check in using the input id.

Parameters:

  • The unique check_in id.

Raises:

  • NotImplementedError

API:

  • private



100
101
102
# File 'lib/honeybadger/backend/base.rb', line 100

def check_in(id)
  raise NotImplementedError, "must define #check_in on subclass."
end

#event(payload) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Send event

Examples:

backend.event([{event_type: "email_received", ts: "2023-03-04T12:12:00+1:00", subject: 'Re: Aquisition' }})

Parameters:

  • array of event hashes to send

Raises:

  • NotImplementedError

API:

  • private



119
120
121
# File 'lib/honeybadger/backend/base.rb', line 119

def event(payload)
  raise NotImplementedError, "must define #event on subclass"
end

#notify(feature, payload) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Process payload for feature.

Examples:

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

Parameters:

  • The feature name (corresponds to HTTP endpoint). Current options are: :notices, :deploys, :ping.

  • The JSON payload to send.

Raises:

  • NotImplementedError

API:

  • private



91
92
93
# File 'lib/honeybadger/backend/base.rb', line 91

def notify(feature, payload)
  raise NotImplementedError, "must define #notify on subclass."
end

#track_deployment(payload) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Track a deployment

Examples:

backend.track_deployment({ revision: 'be2ceb6' })

Parameters:

  • The JSON payload containing all deployment data.

API:

  • private



109
110
111
# File 'lib/honeybadger/backend/base.rb', line 109

def track_deployment(payload)
  notify(:deploys, payload)
end