struct Spectator::Location
- Spectator::Location
- Struct
- Value
- Object
Overview
Defines the file and line number a piece of code originated from.
Defined in:
spectator/location.crConstructors
-
.new(file : String, line : Int32, end_line = nil)
Creates the location.
Class Method Summary
-
.parse(string)
Parses a location from a string.
Instance Method Summary
-
#end_line : Int32
Ending line number in the file.
-
#file : String
Absolute file path.
-
#line : Int32
Starting line number in the file.
-
#path
The relative path to the file from the current directory.
-
#to_s(io)
String representation of the location.
Instance methods inherited from class Object
should(matcher, message = nil)
should,
should_eventually(matcher, message = nil)
should_eventually,
should_never(matcher, message = nil)
should_never,
should_not(matcher, message = nil)
should_not
Constructor Detail
Class Method Detail
def self.parse(string)
#
Parses a location from a string. The string should be in the form:
FILE:LINE
This matches the output of the #to_s
method.
Instance Method Detail
def path
#
The relative path to the file from the current directory. If the file isn't in the current directory or a sub-directory, then the absolute path is provided.