Exception: Glossarist::Errors::LoadError
- Defined in:
- lib/glossarist/errors/load_error.rb
Instance Attribute Summary collapse
-
#path ⇒ Object
Returns the value of attribute path.
-
#reason ⇒ Object
Returns the value of attribute reason.
Instance Method Summary collapse
-
#initialize(path:, reason: nil) ⇒ LoadError
constructor
A new instance of LoadError.
- #to_s ⇒ Object
Constructor Details
#initialize(path:, reason: nil) ⇒ LoadError
Returns a new instance of LoadError.
8 9 10 11 12 13 |
# File 'lib/glossarist/errors/load_error.rb', line 8 def initialize(path:, reason: nil) @path = path @reason = reason super(to_s) end |
Instance Attribute Details
#path ⇒ Object
Returns the value of attribute path.
6 7 8 |
# File 'lib/glossarist/errors/load_error.rb', line 6 def path @path end |
#reason ⇒ Object
Returns the value of attribute reason.
6 7 8 |
# File 'lib/glossarist/errors/load_error.rb', line 6 def reason @reason end |
Instance Method Details
#to_s ⇒ Object
15 16 17 18 19 |
# File 'lib/glossarist/errors/load_error.rb', line 15 def to_s parts = ["Unable to load: #{path}"] parts << reason if reason parts.join(" — ") end |