Class: SmsGateway::Adapters::SmsGlobal
- Inherits:
-
Object
- Object
- SmsGateway::Adapters::SmsGlobal
- Includes:
- HTTParty
- Defined in:
- lib/sms_gateway/adapters/sms_global.rb
Instance Method Summary collapse
-
#initialize(config = {}) ⇒ SmsGlobal
constructor
A new instance of SmsGlobal.
- #send_sms(sms) ⇒ Object
Constructor Details
#initialize(config = {}) ⇒ SmsGlobal
Returns a new instance of SmsGlobal.
10 11 12 13 14 |
# File 'lib/sms_gateway/adapters/sms_global.rb', line 10 def initialize(config={}) @config = {:user => SmsGateway::Base.user, :password => SmsGateway::Base.password, :from => SmsGateway::Base.from} @config.merge!(config) end |
Instance Method Details
#send_sms(sms) ⇒ Object
16 17 18 19 |
# File 'lib/sms_gateway/adapters/sms_global.rb', line 16 def send_sms(sms) = @config.merge({:action => "sendsms", :from => sms.from, :to => sms.to, :text => sms.text}) self.class.post('/http-api.php', :query => ) end |