class Sentry::BreadcrumbBuffer

Experimental RBS support (using type sampling data from the type_fusion project).

# sig/sentry/breadcrumb_buffer.rbs

class Sentry::BreadcrumbBuffer
  def record: (Sentry::Breadcrumb crumb) -> untyped
end

def dup

Returns:
  • (BreadcrumbBuffer) -
def dup
  copy = super
  copy.buffer = buffer.deep_dup
  copy
end

def each(&block)

Returns:
  • (Array) -

Other tags:
    Yieldparam: crumb -

Parameters:
  • block (Proc) --
def each(&block)
  members.each(&block)
end

def empty?

Returns:
  • (Boolean) -
def empty?
  members.none?
end

def initialize(size = nil)

Parameters:
  • size (Integer, nil) -- If it's not provided, it'll fallback to DEFAULT_SIZE
def initialize(size = nil)
  @buffer = Array.new(size || DEFAULT_SIZE)
end

def members

Returns:
  • (Array) -
def members
  @buffer.compact
end

def peek

Returns:
  • (Breadcrumb, nil) -
def peek
  members.last
end

def record(crumb)

Experimental RBS support (using type sampling data from the type_fusion project).

def record: (Sentry::Breadcrumb crumb) -> untyped

This signature was generated using 3 samples from 1 application.

Returns:
  • (void) -

Parameters:
  • crumb (Breadcrumb) --
def record(crumb)
  yield(crumb) if block_given?
  @buffer.slice!(0)
  @buffer << crumb
end

def to_hash

Returns:
  • (Hash) -
def to_hash
  {
    values: members.map(&:to_hash)
  }
end