Exception: Brut::Framework::Errors::NoClassForPath
- Inherits:
-
Brut::Framework::Error
- Object
- StandardError
- Brut::Framework::Error
- Brut::Framework::Errors::NoClassForPath
- Defined in:
- lib/brut/framework/errors/no_class_for_path.rb
Overview
Raised when a path has been declared, but the class to handle it cannot be found in the app.
Instance Attribute Summary collapse
-
#class_name_path ⇒ Array<String>
readonly
Array of names that, if joined with
::
would name the class that could not be found. -
#path_template ⇒ String
readonly
The path template that the class that couldn't be found was intended to handle.
Instance Method Summary collapse
-
#initialize(class_name_path:, path_template:, name_error:) ⇒ NoClassForPath
constructor
Create the exception.
Constructor Details
#initialize(class_name_path:, path_template:, name_error:) ⇒ NoClassForPath
Create the exception
14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/brut/framework/errors/no_class_for_path.rb', line 14 def initialize(class_name_path:, path_template:, name_error:) @class_name_path = class_name_path @path_template = path_template = if name_error.receiver == Module "Could not find" else "Module '#{name_error.receiver}' did not have" end = "Cannot find page class for route '#{path_template}', which should be #{class_name_path.join("::")}. #{} the class or module '#{name_error.name}'" super() end |
Instance Attribute Details
#class_name_path ⇒ Array<String> (readonly)
Array of names that, if joined with ::
would name the class that could not be found
5 6 7 |
# File 'lib/brut/framework/errors/no_class_for_path.rb', line 5 def class_name_path @class_name_path end |
#path_template ⇒ String (readonly)
The path template that the class that couldn't be found was intended to handle
8 9 10 |
# File 'lib/brut/framework/errors/no_class_for_path.rb', line 8 def path_template @path_template end |