Skip to content

Instantly share code, notes, and snippets.

@manojmj92
Created August 4, 2018 07:56
Show Gist options
  • Save manojmj92/362ef9efc0f9b1217dfe4d598f506879 to your computer and use it in GitHub Desktop.
Save manojmj92/362ef9efc0f9b1217dfe4d598f506879 to your computer and use it in GitHub Desktop.
Interactor with New attribute
# Definition of the Interactor
class MyInteractor
include Interactor
def call
puts context.email # => my_email@reflektive.com
puts context.name # => my_name
context.new_attribute = 'some_random_value'
end
end
# Invocation of the Interactor
result = MyInteractor.call(email: 'my_email@reflektive.com', 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