Class: Example::Signup::NotifyUserService

Inherits:
Object
  • Object
show all
Includes:
Workflows::StepService
Defined in:
lib/example/signup/step_services/notify_user.rb

Instance Method Summary collapse

Methods included from Workflows::StepService

#args, #get_output, #get_state, #set_args, #set_output, #set_state

Instance Method Details

#runObject



8
9
10
11
12
13
14
15
16
# File 'lib/example/signup/step_services/notify_user.rb', line 8

def run
  if user.notify
    user.notified = true
    set_state(user: user)
    set_output "#{user.name} is notified."
  else
    raise "Unable to notify user"
  end
end