CHANGELOG.md in bcdd-result-0.5.0 vs CHANGELOG.md in bcdd-result-0.6.0

- old
+ new

@@ -1,9 +1,29 @@ ## [Unreleased] +## [0.6.0] - 2023-10-11 + +### Added + +- Add `BCDD::Result.mixin` to be included or extended in any object. It will add `Success()` and `Failure()` to the target object (the object who receives the include/extend). + +- Add `BCDD::Result.mixin(with: :Continue)`. This addon will add a `Continue(value)` method to the target object to produce a `Success(:continued, value)` result. + +- Add `BCDD::Result::Expectations.mixin(with: :Continue)`, it is similar to `BCDD::Result.mixin(with: :Continue)`, the key difference is that the `Continue(value)` will be ignored by the expectations. This is extremely useful when you want to use `Continue(value)` to chain operations, but you don't want to declare N success types in the expectations. + +- Increase the arity of `BCDD::Result#and_then`. Now, it can receive a second argument (a value to be injected and shared with the subject's method). + +- Increase the arity (maximum of 2) for the methods called through `BCDD::Result#and_then`. The second argument is the value injected by `BCDD::Result#and_then`. + +### Changed + +- **(BREAKING)** Make `BCDD::Result::Mixin` be a private constant. The `BCDD::Result.mixin` method is the new way to use it. + ## [0.5.0] - 2023-10-09 +### Added + - Add `BCDD::Result::Expectations` to define contracts for your results. There are two ways to use it: the standalone (`BCDD::Result::Expectations.new`) and the mixin (`BCDD::Result::Expectations.mixin`) mode. The main difference is that the mixin mode will use the target object (who receives the include/extend) as the result's subject (like the `BCDD::Result::Mixin` does), while the standalone mode won't. **Standalone mode:** @@ -150,11 +170,10 @@ **Module (singleton methods)** ```ruby module Divide - extend BCDD::Resultable - extend self + extend self, BCDD::Resultable def call(arg1, arg2) validate_numbers(arg1, arg2) .and_then(:validate_non_zero) .and_then(:divide)