Class: Messaging

Inherits:
Mobio::WebServices::WsdlDriver
  • Object
show all
Defined in:
lib/rmobio/webservices/soap/messaging.rb

Overview

require ‘drivers’

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.send_sms(countryName, phoneNumber, carrier, text, from) ⇒ Object



72
73
74
# File 'lib/rmobio/webservices/soap/messaging.rb', line 72

def self.send_sms(countryName, phoneNumber, carrier, text, from)
    res = self.driver.sendSMS :countryName => countryName, :phoneNumber => phoneNumber, :carrier => carrier, :text => text, :from => from
end

Instance Method Details

#bulk_smsObject

to be finished



69
70
# File 'lib/rmobio/webservices/soap/messaging.rb', line 69

def bulk_sms
end

#get_carrier_namesObject



55
56
57
58
59
60
61
62
63
64
65
66
# File 'lib/rmobio/webservices/soap/messaging.rb', line 55

def get_carrier_names
  begin
    res = self.class.driver.getCarrierNames
    if res.carrierNames.respond_to? :string
      res.carrierNames.string
    else
      nil
    end
  rescue SOAP::FaultError
    false
  end
end

#get_carriers_for_country(country) ⇒ Object



42
43
44
45
46
47
48
49
50
51
52
53
# File 'lib/rmobio/webservices/soap/messaging.rb', line 42

def get_carriers_for_country(country)
  begin
    res = self.class.driver.getCarriersForCountry :countryName => country
    if res.carrierNames.respond_to? :string
      res.carrierNames.string
    else
      nil
    end
  rescue SOAP::FaultError
    false
  end
end

#get_country_namesObject



33
34
35
36
37
38
39
40
# File 'lib/rmobio/webservices/soap/messaging.rb', line 33

def get_country_names
  begin
    res = self.class.driver.getCountryNames true #not sure if we need to pass it true...
    res.countryNames.string
  rescue SOAP::FaultError
    false
  end
end

#send_email(to, from, subject, body) ⇒ Object



20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/rmobio/webservices/soap/messaging.rb', line 20

def send_email(to, from, subject, body)
  begin
    res = self.class.driver.sendEmail :toAddress => to, :fromAddress => from, :subject => subject, :body => body
    unless res.result.xmlattr_nil == 'true'
      false
    else
      true
    end
  rescue SOAP::FaultError
    false
  end
end