struct Backtracer::Backtrace::Frame
- Backtracer::Backtrace::Frame
- Struct
- Value
- Object
Overview
An object representation of a stack frame.
Defined in:
backtracer/backtrace/frame.crConstructors
Instance Method Summary
- #==(other : self)
-
#absolute_path : String | Nil
Returns:
-
#column : Int32 | Nil
The column number of this frame.
- #context(context_lines : Int32 | Nil = nil) : Context | Nil
-
#hash(hasher)
See
Object#hash(hasher) -
#in_app? : Bool
Returns
trueif this frame originated from the app source code,falseotherwise. -
#inspect(io : IO) : Nil
Appends this struct's name and instance variables names and values to the given IO.
-
#lineno : Int32 | Nil
The line number of this frame.
-
#method : String
The method of this frame (such as
User.find). -
#path : String | Nil
The file name of this frame (such as
app/models/user.cr). -
#relative_path : String | Nil
Returns:
-
#shard_name : String | Nil
Returns name of the shard from which this frame originated.
-
#to_s(io : IO) : Nil
Reconstructs the frame in a readable fashion.
-
#under_src_path? : Bool
Returns
trueif#pathof this frame is within theconfiguration.src_path,falseotherwise.
Constructor Detail
Instance Method Detail
Returns:
Returns Context record consisting of 3 elements - an array of context lines
before the #lineno, line at #lineno, and an array of context lines
after the #lineno. In case of failure it returns nil.
Amount of returned context lines is taken from the context_lines
argument if given, or configuration.context_lines otherwise.
NOTE amount of returned context lines might be lower than given
in cases where #lineno is near the start or the end of the file.
Returns true if this frame originated from the app source code,
false otherwise.
Appends this struct's name and instance variables names and values to the given IO.
struct Point
def initialize(@x : Int32, @y : Int32)
end
end
p1 = Point.new 1, 2
p1.to_s # "Point(@x=1, @y=2)"
p1.inspect # "Point(@x=1, @y=2)"
Returns:
#pathas is, unless it's absolute - i.e. starts with/#pathrelative toconfiguration.src_pathwhen#under_src_path?istruenilotherwise
NOTE returned path is not required to be #under_src_path? - see point no. 1