Class: Opencdd::Cddal::SourceLocation

Inherits:
Struct
  • Object
show all
Defined in:
lib/opencdd/cddal/builder.rb

Overview

Source location attached to every entity created from CDDAL for diagnostics (validator messages, error attribution, cross-file navigation in the editor).

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/opencdd/cddal/builder.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/opencdd/cddal/builder.rb', line 10

def line
  @line
end

Instance Method Details

#to_sObject



11
12
13
# File 'lib/opencdd/cddal/builder.rb', line 11

def to_s
  "#{file}:#{line || '?'}"
end