Class: Bugsnag::Breadcrumbs::Breadcrumb

Inherits:
Object
  • Object
show all
Defined in:
lib/bugsnag/breadcrumbs/breadcrumb.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#autoBoolean (readonly)

Returns set to ‘true` if the breadcrumb was automatically generated.

Returns:

  • (Boolean)

    set to ‘true` if the breadcrumb was automatically generated



15
16
17
# File 'lib/bugsnag/breadcrumbs/breadcrumb.rb', line 15

def auto
  @auto
end

#messageString

The breadcrumb message

Returns:

  • (String)


86
87
88
# File 'lib/bugsnag/breadcrumbs/breadcrumb.rb', line 86

def message
  @name
end

#meta_dataHash?

Deprecated.

Use #metadata instead

Returns metadata hash containing strings, numbers, or booleans, or nil.

Returns:

  • (Hash, nil)

    metadata hash containing strings, numbers, or booleans, or nil



12
13
14
# File 'lib/bugsnag/breadcrumbs/breadcrumb.rb', line 12

def 
  @meta_data
end

#metadataHash?

A Hash containing arbitrary metadata associated with this breadcrumb

Returns:

  • (Hash, nil)


99
100
101
# File 'lib/bugsnag/breadcrumbs/breadcrumb.rb', line 99

def 
  @meta_data
end

#nameString

Deprecated.

Use #message instead

Returns the breadcrumb name.

Returns:

  • (String)

    the breadcrumb name



5
6
7
# File 'lib/bugsnag/breadcrumbs/breadcrumb.rb', line 5

def name
  @name
end

#timestampTime (readonly)

Returns a Time object referring to breadcrumb creation time.

Returns:

  • (Time)

    a Time object referring to breadcrumb creation time



18
19
20
# File 'lib/bugsnag/breadcrumbs/breadcrumb.rb', line 18

def timestamp
  @timestamp
end

#typeString

Returns the breadcrumb type.

Returns:

  • (String)

    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

Returns:

  • (True)

    if ‘ignore!` has been called

  • (nil)

    if ‘ignore` has not been called



59
60
61
# File 'lib/bugsnag/breadcrumbs/breadcrumb.rb', line 59

def ignore?
  @should_ignore
end

#to_hHash

Outputs the breadcrumb data in a formatted hash

These adhere to the breadcrumb format as defined in the Bugsnag error reporting API

Returns:

  • (Hash)

    Hash representation of the breadcrumb



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