Class: RSpec::Signal::Backtrace::Gap

Inherits:
Struct
  • Object
show all
Defined in:
lib/rspec/signal/backtrace/reducer.rb

Overview

A gap standing in for frames that were dropped.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#countObject

Returns the value of attribute count

Returns:

  • (Object)

    the current value of count



9
10
11
# File 'lib/rspec/signal/backtrace/reducer.rb', line 9

def count
  @count
end

#kindObject

Returns the value of attribute kind

Returns:

  • (Object)

    the current value of kind



9
10
11
# File 'lib/rspec/signal/backtrace/reducer.rb', line 9

def kind
  @kind
end

Instance Method Details

#frame?Boolean

Returns:

  • (Boolean)


10
11
12
# File 'lib/rspec/signal/backtrace/reducer.rb', line 10

def frame?
  false
end

#to_hObject



19
20
21
# File 'lib/rspec/signal/backtrace/reducer.rb', line 19

def to_h
  { omitted: count, kind: kind.to_s }
end

#to_sObject



14
15
16
17
# File 'lib/rspec/signal/backtrace/reducer.rb', line 14

def to_s
  noun = kind == :framework ? "framework/runtime" : "library"
  "[#{count} #{noun} frame#{"s" unless count == 1} omitted]"
end