class Bugsnag::Breadcrumbs::Breadcrumb
Attributes
@return [Boolean] set to ‘true` if the breadcrumb was automatically generated
@deprecated Use {#metadata} instead @return [Hash, nil] metadata hash containing strings, numbers, or booleans, or nil
@deprecated Use {#message} instead @return [String] the breadcrumb name
@return [Time] a Time object referring to breadcrumb creation time
@return [String] the breadcrumb type
Public Class Methods
Source
# File lib/bugsnag/breadcrumbs/breadcrumb.rb, line 31 def initialize(name, type, meta_data, auto) @should_ignore = false self.name = name self.type = type self.meta_data = meta_data # Use the symbol comparison to improve readability of breadcrumb creation @auto = auto == :auto # Store it as a timestamp for now @timestamp = Time.now.utc end
Creates a breadcrumb
This will not have been validated, which must occur before this is attached to a report
@api private
@param name [String] the breadcrumb name @param type [String] the breadcrumb type from Bugsnag::BreadcrumbType
@param meta_data
[Hash, nil] a hash containing strings, numbers, or booleans, or nil @param auto [Symbol] set to ‘:auto` if the breadcrumb is automatically generated
Public Instance Methods
Source
# File lib/bugsnag/breadcrumbs/breadcrumb.rb, line 48 def ignore! @should_ignore = true end
Flags the breadcrumb to be ignored
Ignored breadcrumbs will not be attached to a report
Source
# File lib/bugsnag/breadcrumbs/breadcrumb.rb, line 59 def ignore? @should_ignore end
Checks if the ‘ignore!` method has been called
Ignored breadcrumbs will not be attached to a report
@return [True] if ‘ignore!` has been called @return [nil] if `ignore` has not been called
Source
# File lib/bugsnag/breadcrumbs/breadcrumb.rb, line 86 def message @name end
The breadcrumb message @!attribute message @return [String]
Source
# File lib/bugsnag/breadcrumbs/breadcrumb.rb, line 92 def message=(message) @name = message end
@param message [String] @return [void]
Source
# File lib/bugsnag/breadcrumbs/breadcrumb.rb, line 99 def metadata @meta_data end
A Hash containing arbitrary metadata associated with this breadcrumb @!attribute metadata @return [Hash, nil]
Source
# File lib/bugsnag/breadcrumbs/breadcrumb.rb, line 105 def metadata=(metadata) @meta_data = metadata end
@param metadata [Hash, nil] @return [void]
Source
# File lib/bugsnag/breadcrumbs/breadcrumb.rb, line 69 def to_h { :name => @name, :type => @type, :metaData => @meta_data, :timestamp => @timestamp.iso8601(3) } end
Outputs the breadcrumb data in a formatted hash
These adhere to the breadcrumb format as defined in the Bugsnag
error reporting API
@return [Hash] Hash representation of the breadcrumb