Class: Twilio::Rails::Phone::FinishedCallOperation

Inherits:
BaseOperation show all
Defined in:
app/operations/twilio/rails/phone/finished_call_operation.rb

Instance Method Summary collapse

Instance Method Details

#executeObject



6
7
8
9
10
11
12
13
# File 'app/operations/twilio/rails/phone/finished_call_operation.rb', line 6

def execute
  if phone_call.finished?
    Twilio::Rails.config.logger.tagged(self.class) { |l| l.warn("Skipping duplicate finished call job") }
  else
    phone_call.update!(finished: true)
    phone_call.tree.finished_call.call(phone_call) if phone_call.tree.finished_call
  end
end