[ARCHIVED] [[The project is totally redesigned as @smart-rb https://github.com/smart-rb]] Powerful set of common abstractions: Service Object (Operation), IoC Container (Dependency Container), Validation Object, Initialization DSL (and more..) (in active development)
classUserRegistration < SmartCore::Operationparam:userdefcallvalidatesaveendprivatedefvalidateUserValidation.call(user)# another Operation that returns either a Success or a Failureenddefsave# persistence logic that also returns a Success or a Failureendend
Only the last Success is returned, and on any Failure, the execution stops.
Could this be cleanly done with SmartCore? An example of code achieving this would be helpful. Also, I believe this to be a good use case for the library.