Class: CnSms::Adapter::Routo
Instance Method Summary collapse
-
#initialize(config) ⇒ Routo
constructor
A new instance of Routo.
- #send(phone, msg) ⇒ Object
Constructor Details
#initialize(config) ⇒ Routo
Returns a new instance of Routo.
4 5 6 7 8 9 |
# File 'lib/cn_sms/adapter/routo.rb', line 4 def initialize(config) ::Routo.username = config['username'] ::Routo.password = config['password'] ::Routo.ownnum = config["from"] ::Routo.type = "SMS" end |
Instance Method Details
#send(phone, msg) ⇒ Object
11 12 13 14 15 16 |
# File 'lib/cn_sms/adapter/routo.rb', line 11 def send(phone,msg) super(phone,msg) phone = phone.delete "+" ::Routo.send_sms msg,phone puts "sms sent phone:#{phone}. Message:#{msg}" end |