Sha256: 29bb160e190d208d146656fd4c7d87961fa5632967fe12b816382b491f2cc131
Contents?: true
Size: 672 Bytes
Versions: 11
Compression:
Stored size: 672 Bytes
Contents
require "sentry/breadcrumb" module Sentry class BreadcrumbBuffer include Enumerable attr_accessor :buffer def initialize(size = 100) @buffer = Array.new(size) end def record(crumb) yield(crumb) if block_given? @buffer.slice!(0) @buffer << crumb end def members @buffer.compact end def peek members.last end def each(&block) members.each(&block) end def empty? members.none? end def to_hash { :values => members.map(&:to_hash) } end def dup copy = super copy.buffer = buffer.deep_dup copy end end end
Version data entries
11 entries across 11 versions & 2 rubygems