class Zenvia::Sms

Attributes

aggregateId[RW]
cel_phone[RW]
id_sms[RW]
msg[RW]
schedule_date[RW]

Public Class Methods

new(id_sms, msg, cel_phone, schedule_date = "", aggregateId = "") click to toggle source
# File lib/zenvia/sms.rb, line 7
def initialize(id_sms, msg, cel_phone, schedule_date = "", aggregateId = "")
  @id_sms    = id_sms
  @msg       = msg
  @cel_phone = cel_phone
  @aggregateId = aggregateId
  @schedule_date = schedule_date
  #Try to convert datetime to string
  begin
    @schedule_date = schedule_date.strftime("%Y-%m-%dT%H:%M:%S") if !schedule_date.blank?
  rescue
  end
end

Public Instance Methods

send() click to toggle source
# File lib/zenvia/sms.rb, line 20
def send
  send_to_zenvia(@id_sms, @cel_phone, @msg, @schedule_date, @aggregateId)
end