Created
August 4, 2018 07:56
-
-
Save manojmj92/362ef9efc0f9b1217dfe4d598f506879 to your computer and use it in GitHub Desktop.
Interactor with New attribute
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Definition of the Interactor | |
class MyInteractor | |
include Interactor | |
def call | |
puts context.email # => [email protected] | |
puts context.name # => my_name | |
context.new_attribute = 'some_random_value' | |
end | |
end | |
# Invocation of the Interactor | |
result = MyInteractor.call(email: '[email protected]', name: 'my_name') | |
puts result.new_attribute # => some_random_value |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment