struct

Spectator::Location

Inherits Struct / Value / Object

Defines the file and line number a piece of code originated from.

Constructors

new(file : String, line : Int32, end_line = nil)

Creates the location.

Source

Class methods

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.

Source

Instance methods

end_line

Ending line number in the file.

Source
file

Absolute file path.

Source
line

Starting line number in the file.

Source
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.

Source
to_s(io : IO) : Nil

String representation of the location. This is formatted as:

FILE:LINE
Source