Class: CnSms::Adapter::Routo

Inherits:
Base
  • Object
show all
Defined in:
lib/cn_sms/adapter/routo.rb

Instance Method Summary collapse

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