Module: HellioMessaging
- Defined in:
- lib/helliomessaging_sms.rb,
lib/helliomessaging_sms/version.rb
Constant Summary collapse
- VERSION =
"1.0.7"- @@api_username =
nil- @@api_password =
nil- @@api_comsumer_key =
nil- @@api_application_secret =
nil- @@api_senderid =
"HELLIOAPI"
Class Method Summary collapse
- .api_application_secret ⇒ Object
- .api_application_secret=(api_application_secret) ⇒ Object
- .api_consumer_key ⇒ Object
- .api_consumer_key=(api_consumer_key) ⇒ Object
- .api_password ⇒ Object
- .api_password=(api_password) ⇒ Object
- .api_senderid ⇒ Object
- .api_senderid=(api_senderid) ⇒ Object
- .api_username ⇒ Object
- .api_username=(api_username) ⇒ Object
-
.push(options = {}) ⇒ Object
Expects :msg, :to and an optional :from param The :from param defaults to @@api_senderid when its omitted.
Class Method Details
.api_application_secret ⇒ Object
60 |
# File 'lib/helliomessaging_sms.rb', line 60 def self.api_application_secret; @@api_application_secret; end |
.api_application_secret=(api_application_secret) ⇒ Object
59 |
# File 'lib/helliomessaging_sms.rb', line 59 def self.api_application_secret=(api_application_secret); @@api_application_secret = api_application_secret; end |
.api_consumer_key ⇒ Object
57 |
# File 'lib/helliomessaging_sms.rb', line 57 def self.api_consumer_key; @@api_consumer_key; end |
.api_consumer_key=(api_consumer_key) ⇒ Object
56 |
# File 'lib/helliomessaging_sms.rb', line 56 def self.api_consumer_key=(api_consumer_key); @@api_consumer_key = api_consumer_key; end |
.api_password ⇒ Object
54 |
# File 'lib/helliomessaging_sms.rb', line 54 def self.api_password; @@api_password; end |
.api_password=(api_password) ⇒ Object
53 |
# File 'lib/helliomessaging_sms.rb', line 53 def self.api_password=(api_password); @@api_password = api_password; end |
.api_senderid ⇒ Object
63 |
# File 'lib/helliomessaging_sms.rb', line 63 def self.api_senderid; @@api_senderid; end |
.api_senderid=(api_senderid) ⇒ Object
62 |
# File 'lib/helliomessaging_sms.rb', line 62 def self.api_senderid=(api_senderid); @@api_senderid = api_senderid; end |
.api_username ⇒ Object
51 |
# File 'lib/helliomessaging_sms.rb', line 51 def self.api_username; @@api_username; end |
.api_username=(api_username) ⇒ Object
50 |
# File 'lib/helliomessaging_sms.rb', line 50 def self.api_username=(api_username); @@api_username = api_username; end |
.push(options = {}) ⇒ Object
Expects :msg, :to and an optional :from param The :from param defaults to @@api_senderid when its omitted
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/helliomessaging_sms.rb', line 15 def self.push(={}) sender_id = [:from].nil? ? @@api_senderid : [:from] response = nil = [:msg] raise ArgumentError, ':msg and :to params expected' if .nil? || [:to].nil? = Nokogiri::HTML.parse().text # Send SMS Using the old form of Authentication [Username and Password] if @@api_username != nil && @@api_password != nil response = CurbFu.get({:host => 'app.helliomessaging.com/api', :path => '/sms?'}, { :from => sender_id, :to => [:to], :text => , :username => @@api_username, :password => @@api_password }) end # Check Your Account Balance if @@api_username != nil && @@api_password != nil response = CurbFu.get({:host => 'app.helliomessaging.com/api', :path => '/sms-bal?'}, { :username => @@api_username, :password => @@api_password }) end # Send SMS Using the new form of Authentication [Consumer ID and an Application Serect] if @@api_consumer_key != nil && @@api_application_secret != nil response = CurbFu.get({:host => 'app.helliomessaging.com/api', :path => '/sms-dlr?', :protocol => 'http'}, { :From => sender_id, :To => [:to], :Content => , :ClientKey => @@api_consumer_key, :ApplicationSecret => @@api_application_secret }) end # Check for DLR's [Consumer ID and an Application Serect or Username and Password] if @@api_consumer_key != nil && @@api_application_secret != nil response = CurbFu.get({:host => 'app.helliomessaging.com/api', :path => '/sms-dlr?', :protocol => 'http'}, { :From => sender_id, :To => [:to], :Content => , :ClientKey => @@api_consumer_key, :ApplicationSecret => @@api_application_secret }) end {:status => response.status, :notice => response.body} end |