struct Spectator::Source
- Spectator::Source
- Struct
- Value
- Object
Overview
Define the file and line number something originated from.
Defined in:
spectator/source.crConstructors
-
.new(file : String, line : Int32)
Creates the source.
Class Method Summary
-
.parse(string)
Parses a source from a string.
Instance Method Summary
-
#file : String
Absolute file path.
-
#line : Int32
Line number in the file.
-
#path
The relative path to the file from the current directory.
-
#to_json(json : JSON::Builder)
Creates the JSON representation of the source.
-
#to_s(io)
String representation of the source.
Instance methods inherited from class Object
should(matcher)
should,
should_eventually(matcher)
should_eventually,
should_never(matcher)
should_never,
should_not(matcher)
should_not
Constructor Detail
Class Method Detail
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.