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.
-
#message ⇒ String
The breadcrumb message.
-
#meta_data ⇒ Hash?
deprecated
Deprecated.
Use #metadata instead
-
#metadata ⇒ Hash?
A Hash containing arbitrary metadata associated with this breadcrumb.
-
#name ⇒ String
deprecated
Deprecated.
Use #message instead
-
#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.
15 16 17 |
# File 'lib/bugsnag/breadcrumbs/breadcrumb.rb', line 15 def auto @auto end |
#message ⇒ String
The breadcrumb message
86 87 88 |
# File 'lib/bugsnag/breadcrumbs/breadcrumb.rb', line 86 def @name end |
#meta_data ⇒ Hash?
Use #metadata instead
Returns metadata hash containing strings, numbers, or booleans, or nil.
12 13 14 |
# File 'lib/bugsnag/breadcrumbs/breadcrumb.rb', line 12 def @meta_data end |
#metadata ⇒ Hash?
A Hash containing arbitrary metadata associated with this breadcrumb
99 100 101 |
# File 'lib/bugsnag/breadcrumbs/breadcrumb.rb', line 99 def @meta_data end |
#name ⇒ String
Use #message instead
Returns the breadcrumb name.
5 6 7 |
# File 'lib/bugsnag/breadcrumbs/breadcrumb.rb', line 5 def name @name end |
#timestamp ⇒ Time (readonly)
Returns a Time object referring to breadcrumb creation time.
18 19 20 |
# File 'lib/bugsnag/breadcrumbs/breadcrumb.rb', line 18 def @timestamp end |
#type ⇒ String
Returns the breadcrumb type.
8 9 10 |
# File 'lib/bugsnag/breadcrumbs/breadcrumb.rb', line 8 def type @type end |
Instance Method Details
#ignore! ⇒ Object
Flags the breadcrumb to be ignored
Ignored breadcrumbs will not be attached to a report
48 49 50 |
# File 'lib/bugsnag/breadcrumbs/breadcrumb.rb', line 48 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
59 60 61 |
# File 'lib/bugsnag/breadcrumbs/breadcrumb.rb', line 59 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
69 70 71 72 73 74 75 76 |
# File 'lib/bugsnag/breadcrumbs/breadcrumb.rb', line 69 def to_h { :name => @name, :type => @type, :metaData => @meta_data, :timestamp => @timestamp.iso8601(3) } end |