lib/lotus/interactor.rb in lotus-utils-0.4.0 vs lib/lotus/interactor.rb in lotus-utils-0.4.1

- old
+ new

@@ -174,10 +174,12 @@ # # @example Instance variables in result payload # require 'lotus/interactor' # # class Signup + # include Lotus::Interactor + # # def initialize(params) # @params = params # @user = User.new(@params) # @foo = 'bar' # end @@ -196,10 +198,12 @@ # # @example Failed precondition # require 'lotus/interactor' # # class Signup + # include Lotus::Interactor + # # def initialize(params) # @params = params # @user = User.new(@params) # end # @@ -291,10 +295,12 @@ # # When used, the returned result won't be successful. # # @param message [String] the error message # + # @return false + # # @since 0.3.5 # # @see Lotus::Interactor#error! # # @example @@ -334,9 +340,10 @@ # # result.errors # => ["Prepare data error", "Persist error"] # result.logger # => [:prepare_data!, :persist!, :sync!] def error(message) @_errors << message + false end # Log an error AND interrupting the flow. # # When used, the returned result won't be successful.