Class: Cuprum::Errors::OperationNotCalled
- Inherits:
-
Cuprum::Error
- Object
- Cuprum::Error
- Cuprum::Errors::OperationNotCalled
- Defined in:
- lib/cuprum/errors/operation_not_called.rb
Overview
Error returned when trying to access the result of an uncalled Operation.
Constant Summary collapse
- TYPE =
Short string used to identify the type of error.
'cuprum.errors.operation_not_called'
Instance Attribute Summary collapse
-
#operation ⇒ Cuprum::Operation
readonly
The uncalled operation.
Attributes inherited from Cuprum::Error
Instance Method Summary collapse
-
#initialize(operation:) ⇒ OperationNotCalled
constructor
A new instance of OperationNotCalled.
Methods inherited from Cuprum::Error
Constructor Details
#initialize(operation:) ⇒ OperationNotCalled
Returns a new instance of OperationNotCalled.
16 17 18 19 20 21 22 23 |
# File 'lib/cuprum/errors/operation_not_called.rb', line 16 def initialize(operation:) @operation = operation class_name = operation&.class&.name || 'operation' = MESSAGE_FORMAT % class_name super(message: , operation: operation) end |
Instance Attribute Details
#operation ⇒ Cuprum::Operation (readonly)
Returns The uncalled operation.
26 27 28 |
# File 'lib/cuprum/errors/operation_not_called.rb', line 26 def operation @operation end |