lib/hanami/interactor.rb in hanami-utils-1.0.0 vs lib/hanami/interactor.rb in hanami-utils-1.0.1
- old
+ new
@@ -203,16 +203,15 @@
# include Hanami::Interactor
# expose :user, :params
#
# def initialize(params)
# @params = params
- # @user = User.new(@params)
# @foo = 'bar'
# end
#
# def call
- # @user = UserRepository.new.persist(@user)
+ # @user = UserRepository.new.create(@params)
# end
# end
#
# result = Signup.new(name: 'Luca').call
# result.failure? # => false
@@ -229,16 +228,15 @@
# include Hanami::Interactor
# expose :user
#
# def initialize(params)
# @params = params
- # @user = User.new(@params)
# end
#
# # THIS WON'T BE INVOKED BECAUSE #valid? WILL RETURN false
# def call
- # @user = UserRepository.new.persist(@user)
+ # @user = UserRepository.new.create(@params)
# end
#
# private
# def valid?
# @params.valid?
@@ -290,20 +288,19 @@
# class CreateEmailTest
# include Hanami::Interactor
#
# def initialize(params)
# @params = params
- # @email_test = EmailTest.new(@params)
# end
#
# def call
# persist_email_test!
# capture_screenshot!
# end
#
# private
# def persist_email_test!
- # @email_test = EmailTestRepository.new.persist(@email_test)
+ # @email_test = EmailTestRepository.new.create(@params)
# end
#
# # IF THIS RAISES AN EXCEPTION WE FORCE A FAILURE
# def capture_screenshot!
# Screenshot.new(@email_test).capture!