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.
16 17 18 19 20 21 |
# File 'lib/bibliothecary/exceptions.rb', line 16 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.to_s) end |
Instance Attribute Details
#filename ⇒ Object
Returns the value of attribute filename.
14 15 16 |
# File 'lib/bibliothecary/exceptions.rb', line 14 def filename @filename end |
#location ⇒ Object
Returns the value of attribute location.
14 15 16 |
# File 'lib/bibliothecary/exceptions.rb', line 14 def location @location end |