Class: Raygun::Breadcrumbs::Breadcrumb

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

Constant Summary collapse

ATTRIBUTES =
[
  :message, :category, :metadata, :class_name,
  :method_name, :line_number, :timestamp, :level,
  :type
]

Instance Method Summary collapse

Instance Method Details

#build_payloadObject



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/raygun/breadcrumbs/breadcrumb.rb', line 11

def build_payload
  payload = {
    message: message,
    category: category,
    level: Breadcrumbs::BREADCRUMB_LEVELS.index(level),
    CustomData: ,
    timestamp: timestamp,
    type: type
  }

  payload[:location] = "#{class_name}:#{method_name}" unless class_name == nil
  payload[:location] += ":#{line_number}" if payload.has_key?(:location) && line_number != nil

  Hash[payload.select do |k, v|
    v != nil
  end]
end

#sizeObject



29
30
31
# File 'lib/raygun/breadcrumbs/breadcrumb.rb', line 29

def size
  return message.length + 100
end