Exception: Bibliothecary::FileParsingError
- Inherits:
-
StandardError
- Object
- StandardError
- Bibliothecary::FileParsingError
- Defined in:
- lib/bibliothecary/exceptions.rb
Instance Attribute Summary collapse
-
#filename ⇒ Object
Returns the value of attribute filename.
-
#location ⇒ Object
Returns the value of attribute location.
Instance Method Summary collapse
-
#initialize(msg, filename, location = nil) ⇒ FileParsingError
constructor
A new instance of FileParsingError.
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
#filename ⇒ Object
Returns the value of attribute filename.
11 12 13 |
# File 'lib/bibliothecary/exceptions.rb', line 11 def filename @filename end |
#location ⇒ Object
Returns the value of attribute location.
11 12 13 |
# File 'lib/bibliothecary/exceptions.rb', line 11 def location @location end |