struct Spectator::Location


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

Defined in:



Class Method Summary

Instance Method Summary

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

def : String, line : Int32, end_line = nil) #

Creates the location.

[View source]

Class Method Detail

def self.parse(string) #

Parses a location from a string. The string should be in the form:


This matches the output of the #to_s method.

[View source]

Instance Method Detail

def end_line : Int32 #

Ending line number in the file.

[View source]
def file : String #

Absolute file path.

[View source]
def line : Int32 #

Starting line number in the file.

[View source]
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.

[View source]
def to_s(io) #

String representation of the location. This is formatted as:


[View source]