Class: Cuprum::Rails::Errors::ResourceError
- Inherits:
-
Error
- Object
- Error
- Cuprum::Rails::Errors::ResourceError
- Defined in:
- lib/cuprum/rails/errors/resource_error.rb
Overview
Error class when a resource is not correctly configured for an action.
Constant Summary collapse
- TYPE =
Short string used to identify the type of error.
'cuprum.rails.errors.resource_error'
Instance Attribute Summary collapse
-
#resource ⇒ Cuprum::Rails::Resource
readonly
The errored resource.
Instance Method Summary collapse
-
#initialize(resource:, message: nil) ⇒ ResourceError
constructor
A new instance of ResourceError.
Constructor Details
#initialize(resource:, message: nil) ⇒ ResourceError
Returns a new instance of ResourceError.
15 16 17 18 19 |
# File 'lib/cuprum/rails/errors/resource_error.rb', line 15 def initialize(resource:, message: nil) @resource = resource super(message: (), resource: resource) end |
Instance Attribute Details
#resource ⇒ Cuprum::Rails::Resource (readonly)
Returns the errored resource.
22 23 24 |
# File 'lib/cuprum/rails/errors/resource_error.rb', line 22 def resource @resource end |