Class: Smstrade
- Inherits:
-
Object
- Object
- Smstrade
- Defined in:
- lib/smstrade.rb
Overview
Copyright © 2010 Maikel Urlitzki <[email protected]>
Thanks to github.com/splattael
github.com/maikelcoke/smstrade_de
For use with www.smstrade.de
Configuration
# config/intializers/smstrade.rb
Smstrade.key = "YOUR_KEY"
Smstrade.route = "ROUTE"
Instance Method Summary collapse
-
#initialize {|_self| ... } ⇒ Smstrade
constructor
Example:.
-
#send(options = {}) ⇒ Object
- Required
optionsare::number -
Mobile number e.g.
- Required
Constructor Details
Instance Method Details
#send(options = {}) ⇒ Object
Required options are:
:number-
Mobile number e.g. +49160123456
:text-
SMS-Text e.g. “Hello mate, all right?”
Optional options are:
:debug-
Debug mode 0 = send the message 1 = sms will not send and not charged
62 63 64 65 66 67 68 69 70 |
# File 'lib/smstrade.rb', line 62 def send(={}) string = prepare_string() begin response = Net::HTTP::get(gateway, "#{string}") rescue response = 0 end return (response.to_i == 100), response(response.to_i) end |