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.
Data object that encapsulates the result of calling a Cuprum command.
STATUSES
= %i[success failure].freeze
Enumerates the default permitted values for a Result#status.
#initialize(value: nil, error: nil, status: nil) => Result
#error => Object (readonly)
#status => Symbol (readonly)
#value => Object (readonly)
#==(other) => Boolean
Compares the other object to the result.
In order to match the result, the object must respond to the #to_h method, and the value of object.to_h must be equal to the value of result.properties.
#failure? => Boolean
#properties => Hash{Symbol => Object}
Also known as:
to_h
#success? => Boolean
#to_cuprum_result => Cuprum::Result
Back to Documentation | Versions | 1.3 | Reference | Cuprum