All notable changes to this project will be documented in this file. This project adheres to Semantic Versioning.
Features:
- Automatically generate "*?" methods for boolean comparison.
Fixes:
- The
play
method recognizes as actors anything that inherits fromServiceActor::Core
instead of justActor
. - The
play
method does not try to merge results of lambdas returning hashes. - Remove warning when calling
#rollback
.
Fixes:
- The
in:
option supports thedefault:
keyword as well.
Fixes:
- Ruby 2.4 and 3 support
Added:
- Add
fail_on
to catch argument errors and turn them into actor failures.
Fixes:
- Harmonize error messages by removing trailing dots.
Added:
- Add
in:
option to inputs to ensure they match a given collection. - Add support for instances of Interactor when using
play
.
Breaking changes:
- Dropped deprecated support for
call!
on an actor. - Dropped deprecated support for
succeed!
inside an actor. - Dropped deprecated support for
context
inside an actor. - Dropped deprecated support for
required
in input and output definitions.
Breaking changes:
- Disallow nil when a type is set by default and the default is not nil.
Added:
- Move all code inside
ServiceActor
, only exposing a baseActor
, enabling you to change the default class name. - Rename
Actor::Context
toServiceActor::Result
. - Deprecate
context.
in favor ofresult.
. - Outputs add writer methods inside your actors, so you can do
self.name =
instead ofresult.name =
. - Outputs adds reader methods as well, so you can use anything you just set on the result right away inside your actor.
- Deprecate
required: true
in favor ofallow_nil: false
. - All errors inherit from
ServiceActor::Error
. - In case of argument errors, raise an
ServiceActor::ArgumentError
instead of aArgumentError
. - Allow classes as well as strings in type definitions.
- Deprecate early success in favor of play conditions.
Fixes:
- Allow inputs and outputs called
before
,after
andrun
. - Do not raise an error when accessing
result.
with unknown inputs or outputs.
Added:
- An error is raised if inputs have not been given and have no default.
- Fix assigning hashes and blocks to the output.
- Add compatibility to organizers from the Interactor gem.
Added:
- First version \o/