Exception: JsxRosetta::ParseError

Inherits:
Error
  • Object
show all
Defined in:
lib/jsx_rosetta/parse_error.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message, line: nil, column: nil) ⇒ ParseError

Returns a new instance of ParseError.



7
8
9
10
11
# File 'lib/jsx_rosetta/parse_error.rb', line 7

def initialize(message, line: nil, column: nil)
  super(message)
  @line = line
  @column = column
end

Instance Attribute Details

#columnObject (readonly)

Returns the value of attribute column.



5
6
7
# File 'lib/jsx_rosetta/parse_error.rb', line 5

def column
  @column
end

#lineObject (readonly)

Returns the value of attribute line.



5
6
7
# File 'lib/jsx_rosetta/parse_error.rb', line 5

def line
  @line
end

Instance Method Details

#to_sObject



13
14
15
16
17
# File 'lib/jsx_rosetta/parse_error.rb', line 13

def to_s
  return super if line.nil?

  "#{super} (#{line}:#{column})"
end