All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
- Drop Support to Ruby 2.6 and 2.7
- Add Support to Ruby 3.2 and 3.3
- Changed and_error to use a matcher instead of equality comparation #51
- Added Rspec Helper
#mock_service
#41; - Added Rspec Matcher
#have_succeed_with
and#have_failed_with
#41; - Added
Success()
,Failure()
,Check()
,Try()
now can be multipe types #41; - Changed Depreacate
Result#type
method #41; - Changed Deprecate method
#then
for Success and Failure classes #40 - Added RSpec support for mock and match results #35
- Deprecate method
#then
for Success and Failure classes #40; - Removed deprecated method
#on
#33 - Changed Capture just one callback per result #30;
- Add
and_then
as alias forthen
(partially fix #23). - Add
catch
toFailure
andSuccess
. It acts as an invertedthen
and has aor_else
alias. - Add support to custom
data
property to be passed when callingBase#Check
. - Add support to multiple type checks on
Result#on_success
andResult#on_failure
hooks. - Yields result type on blocks (
then
,on_success
andon_failure
). - Add type check on
Result#on_success
andResult#on_failure
hooks. - Add method
Base#Try
. It wraps exceptions in Failures. - Add method
Base#Check
. It converts booleans to Results. - Add methods
#Success(type, data:)
and#Failure(type, data:)
onFService::Base
. These methods allow defining the type and value of the Result object. - Allow adding types on
Result
s. - Add
#on_success
and#on_failure
hooks on Result objects. - Link to Changelog on gemspec.
- [Deprecation] Mark
Base#result
as deprecated. They will be removed on the next release. Use theBase#Check
instead. - [Deprecation] Mark
Base#success
andBase#failure
as deprecated. They will be removed on the next release. Use theBase#Success
andBase#Failure
instead. - [Deprecation] Mark
Result#on
as deprecated. It will be removed on the next release. Use theResult#on_success
and/orResult#on_failure
hooks instead.
First usable version with:
- Result based services
- Type check on results
- Pattern matching with
#call
ables - Safe chaining calls with
#then
- Yanked