Exception: Glossarist::ParseError

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(filename:, line: nil) ⇒ ParseError

Returns a new instance of ParseError.



5
6
7
8
9
10
# File 'lib/glossarist/error/parse_error.rb', line 5

def initialize(filename:, line: nil)
  @filename = filename
  @line = line

  super()
end

Instance Attribute Details

#filenameObject

Returns the value of attribute filename.



3
4
5
# File 'lib/glossarist/error/parse_error.rb', line 3

def filename
  @filename
end

#lineObject

Returns the value of attribute line.



3
4
5
# File 'lib/glossarist/error/parse_error.rb', line 3

def line
  @line
end

Instance Method Details

#to_sObject



12
13
14
# File 'lib/glossarist/error/parse_error.rb', line 12

def to_s
  "Unable to parse file: #{filename}, error on line: #{line}"
end