Class: RSpec::Signal::Backtrace::Reduced
- Inherits:
-
Object
- Object
- RSpec::Signal::Backtrace::Reduced
- Defined in:
- lib/rspec/signal/backtrace/reducer.rb
Overview
The result of reducing one backtrace.
Instance Attribute Summary collapse
-
#entries ⇒ Object
readonly
Returns the value of attribute entries.
-
#fallback ⇒ Object
readonly
Returns the value of attribute fallback.
-
#omitted ⇒ Object
readonly
Returns the value of attribute omitted.
-
#total ⇒ Object
readonly
Returns the value of attribute total.
Instance Method Summary collapse
-
#culprit ⇒ Object
The frame that best identifies where this blew up: the innermost frame that is not test-runner plumbing.
- #empty? ⇒ Boolean
- #fallback? ⇒ Boolean
- #frames ⇒ Object
-
#initialize(entries:, total:, omitted:, fallback: false) ⇒ Reduced
constructor
A new instance of Reduced.
- #kept_count ⇒ Object
- #omitted_count ⇒ Object
-
#primary_location ⇒ Object
The innermost first-party frame — what the agent should open first.
- #project_frames ⇒ Object
- #to_a ⇒ Object
Constructor Details
#initialize(entries:, total:, omitted:, fallback: false) ⇒ Reduced
Returns a new instance of Reduced.
35 36 37 38 39 40 |
# File 'lib/rspec/signal/backtrace/reducer.rb', line 35 def initialize(entries:, total:, omitted:, fallback: false) @entries = entries @total = total @omitted = omitted @fallback = fallback end |
Instance Attribute Details
#entries ⇒ Object (readonly)
Returns the value of attribute entries.
33 34 35 |
# File 'lib/rspec/signal/backtrace/reducer.rb', line 33 def entries @entries end |
#fallback ⇒ Object (readonly)
Returns the value of attribute fallback.
33 34 35 |
# File 'lib/rspec/signal/backtrace/reducer.rb', line 33 def fallback @fallback end |
#omitted ⇒ Object (readonly)
Returns the value of attribute omitted.
33 34 35 |
# File 'lib/rspec/signal/backtrace/reducer.rb', line 33 def omitted @omitted end |
#total ⇒ Object (readonly)
Returns the value of attribute total.
33 34 35 |
# File 'lib/rspec/signal/backtrace/reducer.rb', line 33 def total @total end |
Instance Method Details
#culprit ⇒ Object
The frame that best identifies where this blew up: the innermost frame that is not test-runner plumbing.
68 69 70 |
# File 'lib/rspec/signal/backtrace/reducer.rb', line 68 def culprit frames.first end |
#empty? ⇒ Boolean
58 59 60 |
# File 'lib/rspec/signal/backtrace/reducer.rb', line 58 def empty? frames.empty? end |
#fallback? ⇒ Boolean
54 55 56 |
# File 'lib/rspec/signal/backtrace/reducer.rb', line 54 def fallback? @fallback end |
#frames ⇒ Object
42 43 44 |
# File 'lib/rspec/signal/backtrace/reducer.rb', line 42 def frames entries.select(&:frame?) end |
#kept_count ⇒ Object
50 51 52 |
# File 'lib/rspec/signal/backtrace/reducer.rb', line 50 def kept_count frames.size end |
#omitted_count ⇒ Object
62 63 64 |
# File 'lib/rspec/signal/backtrace/reducer.rb', line 62 def omitted_count omitted.values.sum end |
#primary_location ⇒ Object
The innermost first-party frame — what the agent should open first.
73 74 75 |
# File 'lib/rspec/signal/backtrace/reducer.rb', line 73 def primary_location project_frames.first end |
#project_frames ⇒ Object
46 47 48 |
# File 'lib/rspec/signal/backtrace/reducer.rb', line 46 def project_frames frames.select(&:project?) end |
#to_a ⇒ Object
77 78 79 |
# File 'lib/rspec/signal/backtrace/reducer.rb', line 77 def to_a entries.map(&:to_s) end |