Class: TotalVoice::SMS

Inherits:
Base
  • Object
show all
Defined in:
lib/total_voice/sms.rb

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from TotalVoice::Base

Instance Method Details

#send(phone_number, message, wait_for_user_anwser = false, slow_multi_sms = false) ⇒ Object

Send audo message to the given number



7
8
9
10
11
12
13
14
15
16
# File 'lib/total_voice/sms.rb', line 7

def send(phone_number, message, wait_for_user_anwser=false, slow_multi_sms=false)
  body = {
    numero_destino: phone_number,
    mensagem: message,
    resposta_usuario: wait_for_user_anwser,
    multi_sms: slow_multi_sms
  }

  puts self.class.post('/sms', {body: body.to_json})
end