class Honeybadger::Event
Attributes
The event_type
of the event
The payload data of the event
The timestamp of the event
Public Class Methods
Source
# File lib/honeybadger/event.rb, line 21 def initialize(event_type_or_payload, payload={}) if event_type_or_payload.is_a?(String) @event_type = event_type_or_payload @payload = payload elsif event_type_or_payload.is_a?(Hash) @event_type = event_type_or_payload[:event_type] || event_type_or_payload["event_type"] @payload = event_type_or_payload end @ts = payload[:ts] || Time.now.utc.strftime("%FT%T.%LZ") @halted = false end
@api private
Public Instance Methods
Source
# File lib/honeybadger/event.rb, line 51 def as_json(*args) data = payload.tap do |p| p[:ts] = ts p[:event_type] = event_type if event_type end Util::Sanitizer.sanitize(data) end
@api private Template used to create JSON payload.
@return [Hash] JSON representation of the event.
Source
Source
# File lib/honeybadger/event.rb, line 43 def halted? !!@halted end
@api private Determines if this event will be discarded.