Sha256: cb6d84222f7414d1458a8c4f9e0114df0ff3533b6e11cad099cd2ae4b208ca7b

Contents?: true

Size: 787 Bytes

Versions: 12

Compression:

Stored size: 787 Bytes

Contents

module Raygun
  module Breadcrumbs
    class Breadcrumb
      ATTRIBUTES = [
        :message, :category, :metadata, :class_name,
        :method_name, :line_number, :timestamp, :level,
        :type
      ]
      attr_accessor(*ATTRIBUTES)

      def build_payload
        payload = {
          message: message,
          category: category,
          level: Breadcrumbs::BREADCRUMB_LEVELS.index(level),
          CustomData: metadata,
          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
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
raygun4ruby-3.1.1 lib/raygun/breadcrumbs/breadcrumb.rb
raygun4ruby-3.1.0 lib/raygun/breadcrumbs/breadcrumb.rb
raygun4ruby-3.0.0 lib/raygun/breadcrumbs/breadcrumb.rb
raygun4ruby-2.7.1 lib/raygun/breadcrumbs/breadcrumb.rb
raygun4ruby-2.7.0 lib/raygun/breadcrumbs/breadcrumb.rb
raygun4ruby-2.6.0 lib/raygun/breadcrumbs/breadcrumb.rb
raygun4ruby-2.5.0 lib/raygun/breadcrumbs/breadcrumb.rb
raygun4ruby-2.4.1 lib/raygun/breadcrumbs/breadcrumb.rb
raygun4ruby-2.4.0 lib/raygun/breadcrumbs/breadcrumb.rb
raygun4ruby-2.3.0 lib/raygun/breadcrumbs/breadcrumb.rb
raygun4ruby-2.2.0 lib/raygun/breadcrumbs/breadcrumb.rb
raygun4ruby-2.1.0 lib/raygun/breadcrumbs/breadcrumb.rb