Class: Lilac::CLI::SourceLocation

Inherits:
Struct
  • Object
show all
Defined in:
lib/lilac/cli/source_location.rb

Overview

(file, line) pair that appears in every build-time error and lint warning. Kept as one value so error/warning constructors take a single at: kwarg instead of two, and so future additions (column, snippet excerpt, end-line for ranges) can be tacked on here without rippling through every raise site.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#fileObject

Returns the value of attribute file

Returns:

  • (Object)

    the current value of file



10
11
12
# File 'lib/lilac/cli/source_location.rb', line 10

def file
  @file
end

#lineObject

Returns the value of attribute line

Returns:

  • (Object)

    the current value of line



10
11
12
# File 'lib/lilac/cli/source_location.rb', line 10

def line
  @line
end

Instance Method Details

#to_sObject



11
12
13
# File 'lib/lilac/cli/source_location.rb', line 11

def to_s
  "#{file}:#{line}"
end