An opinionated implementation of the Command pattern for Ruby applications. Cuprum wraps your business logic in a consistent, object-oriented interface and features status and error management, composability and control flow management.
Error class to be used when trying to access the result of an uncalled Operation.
MESSAGE_FORMAT
= '%s was not called and does not have a result'
Format for generating error message.
TYPE
= 'cuprum.errors.operation_not_called'
Short string used to identify the type of error.
#initialize(operation:) => OperationNotCalled
#message => String (readonly)
#operation => Cuprum::Operation (readonly)
#type => String (readonly)
#==(other) => Boolean
#as_json => Hash<String, Object>
Generates a serializable representation of the error object.
By default, contains the #type and #message properties and an empty :data Hash. This can be overriden in subclasses by overriding the private method #as_json_data; this should always return a Hash with String keys and whose values are basic objects or data structures of the same.
Back to Documentation | Versions | 1.0 | Reference | Cuprum | Cuprum::Errors