Class: Backtrace
- Inherits:
-
Object
- Object
- Backtrace
- Defined in:
- lib/backtrace.rb
Overview
Backtrace as a string.
- Author
-
Yegor Bugayenko ([email protected])
- Copyright
-
Copyright © 2018 Yegor Bugayenko
- License
-
MIT
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(exp, stop: '') ⇒ Backtrace
constructor
A new instance of Backtrace.
- #to_s ⇒ Object
Constructor Details
#initialize(exp, stop: '') ⇒ Backtrace
Returns a new instance of Backtrace.
30 31 32 33 |
# File 'lib/backtrace.rb', line 30 def initialize(exp, stop: '') @exp = exp @stop = stop end |
Class Method Details
Instance Method Details
#to_s ⇒ Object
35 36 37 38 39 40 41 42 43 44 |
# File 'lib/backtrace.rb', line 35 def to_s [ @exp.class.name, ': ', @exp., "\n\t", @exp.backtrace.reverse.drop_while { |t| !t.include?(@stop) } .reverse.join("\n\t") ].join end |