class Vonage::SMS
Public Instance Methods
send(params)
click to toggle source
# File lib/vonage/sms.rb, line 96 def send(params) if unicode?(params.fetch(:text)) && params[:type] != 'unicode' message = 'Sending unicode text SMS without setting the type parameter to "unicode". ' \ 'See https://developer.nexmo.com/messaging/sms for details, ' \ 'or email support@nexmo.com if you have any questions.' logger.warn(message) end response = request('/sms/json', params: hyphenate(params), type: Post) unless response.messages.first.status == '0' raise Error, response.messages.first[:error_text] end response end
Private Instance Methods
unicode?(text)
click to toggle source
# File lib/vonage/sms.rb, line 117 def unicode?(text) !Vonage::GSM7.encoded?(text) end