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



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

def auto
  @auto
end

#meta_dataHash?

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

Returns:

  • (Hash, nil)

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



10
11
12
# File 'lib/bugsnag/breadcrumbs/breadcrumb.rb', line 10

def 
  @meta_data
end

#nameString

Returns the breadcrumb name.

Returns:

  • (String)

    the breadcrumb name



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

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



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

def timestamp
  @timestamp
end

#typeString

Returns the breadcrumb type.

Returns:

  • (String)

    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

Returns:

  • (True)

    if ‘ignore!` has been called

  • (nil)

    if ‘ignore` has not been called



57
58
59
# File 'lib/bugsnag/breadcrumbs/breadcrumb.rb', line 57

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



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