Exception: Bibliothecary::FileParsingError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/bibliothecary/exceptions.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(msg, filename, location = nil) ⇒ FileParsingError

Returns a new instance of FileParsingError.



12
13
14
15
16
17
# File 'lib/bibliothecary/exceptions.rb', line 12

def initialize(msg, filename, location=nil)
  @filename = filename
  @location = location # source code location of the error, e.g. "lib/hi.rb:34"
  msg = "#{filename}: #{msg}" unless msg.include?(filename)
  super("#{msg}")
end

Instance Attribute Details

#filenameObject

Returns the value of attribute filename.



11
12
13
# File 'lib/bibliothecary/exceptions.rb', line 11

def filename
  @filename
end

#locationObject

Returns the value of attribute location.



11
12
13
# File 'lib/bibliothecary/exceptions.rb', line 11

def location
  @location
end