Class: Bugsnag::Breadcrumbs::Breadcrumb
- Inherits:
-
Object
- Object
- Bugsnag::Breadcrumbs::Breadcrumb
- Defined in:
- lib/bugsnag/breadcrumbs/breadcrumb.rb
Instance Attribute Summary collapse
-
#auto ⇒ Boolean
readonly
Set to ‘true` if the breadcrumb was automatically generated.
-
#meta_data ⇒ Hash?
Metadata hash containing strings, numbers, or booleans, or nil.
-
#name ⇒ String
The breadcrumb name.
-
#timestamp ⇒ Time
readonly
A Time object referring to breadcrumb creation time.
-
#type ⇒ String
The breadcrumb type.
Instance Method Summary collapse
-
#ignore! ⇒ Object
Flags the breadcrumb to be ignored.
-
#ignore? ⇒ True?
Checks if the ‘ignore!` method has been called.
-
#to_h ⇒ Hash
Outputs the breadcrumb data in a formatted hash.
Instance Attribute Details
#auto ⇒ Boolean (readonly)
Returns set to ‘true` if the breadcrumb was automatically generated.
13 14 15 |
# File 'lib/bugsnag/breadcrumbs/breadcrumb.rb', line 13 def auto @auto end |
#meta_data ⇒ Hash?
Returns metadata hash containing strings, numbers, or booleans, or nil.
10 11 12 |
# File 'lib/bugsnag/breadcrumbs/breadcrumb.rb', line 10 def @meta_data end |
#name ⇒ String
Returns the breadcrumb name.
4 5 6 |
# File 'lib/bugsnag/breadcrumbs/breadcrumb.rb', line 4 def name @name end |
#timestamp ⇒ Time (readonly)
Returns a Time object referring to breadcrumb creation time.
16 17 18 |
# File 'lib/bugsnag/breadcrumbs/breadcrumb.rb', line 16 def @timestamp end |
#type ⇒ String
Returns the breadcrumb type.
7 8 9 |
# File 'lib/bugsnag/breadcrumbs/breadcrumb.rb', line 7 def type @type end |
Instance Method Details
#ignore! ⇒ Object
Flags the breadcrumb to be ignored
Ignored breadcrumbs will not be attached to a report
46 47 48 |
# File 'lib/bugsnag/breadcrumbs/breadcrumb.rb', line 46 def ignore! @should_ignore = true end |
#ignore? ⇒ True?
Checks if the ‘ignore!` method has been called
Ignored breadcrumbs will not be attached to a report
57 58 59 |
# File 'lib/bugsnag/breadcrumbs/breadcrumb.rb', line 57 def ignore? @should_ignore end |
#to_h ⇒ Hash
Outputs the breadcrumb data in a formatted hash
These adhere to the breadcrumb format as defined in the Bugsnag error reporting API
67 68 69 70 71 72 73 74 |
# File 'lib/bugsnag/breadcrumbs/breadcrumb.rb', line 67 def to_h { :name => @name, :type => @type, :metaData => @meta_data, :timestamp => @timestamp.iso8601(3) } end |