Exception: Glossarist::Errors::LoadError

Inherits:
Base
  • Object
show all
Defined in:
lib/glossarist/errors/load_error.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#pathObject

Returns the value of attribute path.



6
7
8
# File 'lib/glossarist/errors/load_error.rb', line 6

def path
  @path
end

#reasonObject

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_sObject



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