Class: CnSms::Adapter::Smsxchange

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

Instance Method Summary collapse

Constructor Details

#initialize(config) ⇒ Smsxchange

Returns a new instance of Smsxchange.



6
7
8
# File 'lib/cn_sms/adapter/smsxchange.rb', line 6

def initialize(config)
  @client = SmsXchange.new(:username=>config['username'],:password=>config['password'],:from=>config["from"])
end

Instance Method Details

#send(phone, msg) ⇒ Object



10
11
12
13
14
# File 'lib/cn_sms/adapter/smsxchange.rb', line 10

def send(phone,msg)
  super(phone,msg)
  @client.send(phone,msg)
  puts "sms sent phone:#{phone}. Message:#{msg}"
end