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 returned when a command’s parameters fail validation.
TYPE
= 'cuprum.errors.invalid_parameters'
Short string used to identify the type of error.
#initialize(command_class:, failures:) => InvalidParameters
#command_class => Class (readonly)
#failures => Array<String> (readonly)
#message => String (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 overridden 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 | Reference | Cuprum | Cuprum::Errors