class Skuby::SMSResponse

Attributes

recipients[R]
response[R]
text[R]

Public Class Methods

new(response, text, recipients) click to toggle source
# File lib/skuby/sms_response.rb, line 5
def initialize(response, text, recipients)
  @response = CGI.parse(response)
  @text = text
  @recipients = Array(recipients)
end

Public Instance Methods

error_code() click to toggle source
# File lib/skuby/sms_response.rb, line 31
def error_code
  @response["code"].first.to_i
end
error_message() click to toggle source
# File lib/skuby/sms_response.rb, line 35
def error_message
  @response["message"].first
end
remaining_sms() click to toggle source
# File lib/skuby/sms_response.rb, line 23
def remaining_sms
  @response["remaining_sms"].first.to_i
end
sms_id() click to toggle source
# File lib/skuby/sms_response.rb, line 27
def sms_id
  @response["id"].first
end
sms_id?() click to toggle source
# File lib/skuby/sms_response.rb, line 15
def sms_id?
  !sms_id.nil?
end
status() click to toggle source
# File lib/skuby/sms_response.rb, line 19
def status
  @response["status"].first
end
success?() click to toggle source
# File lib/skuby/sms_response.rb, line 11
def success?
  status == "success"
end