Class: SmsOnRails::ServiceProviders::Clickatell
- Defined in:
- lib/sms_on_rails/service_providers/clickatell.rb
Constant Summary collapse
- FATAL_ERROR_CODES =
%w(105 114)
Instance Method Summary collapse
- #authenticate ⇒ Object
-
#initialize ⇒ Clickatell
constructor
A new instance of Clickatell.
- #ping ⇒ Object
-
#send_message(phone_number, message, options = {}) ⇒ Object
Send a message without validation * phone_number - phone number string digits * message - the message text * options - anything else.
Methods inherited from Base
#deliver, get_service_provider, human_name, max_characters, name, provider_by_id, provider_by_name, provider_list, provider_map, #requires_carrier?, #send_sms, #send_to_phone, set_default_service_provider
Constructor Details
#initialize ⇒ Clickatell
Returns a new instance of Clickatell.
10 11 12 13 14 15 16 17 |
# File 'lib/sms_on_rails/service_providers/clickatell.rb', line 10 def initialize begin require 'clickatell' rescue LoadError => exc raise LoadError.new(exc.to_s + " Please make sure the clickatell gem is installed.") end super end |
Instance Method Details
#authenticate ⇒ Object
24 25 26 |
# File 'lib/sms_on_rails/service_providers/clickatell.rb', line 24 def authenticate invoke_clickatell{ api } end |
#ping ⇒ Object
19 20 21 22 |
# File 'lib/sms_on_rails/service_providers/clickatell.rb', line 19 def ping result = invoke_clickatell{ api.ping(nil) } result.is_a?(Net::HTTPOK) end |
#send_message(phone_number, message, options = {}) ⇒ Object
Send a message without validation
-
phone_number - phone number string digits
-
message - the message text
-
options - anything else
32 33 34 35 |
# File 'lib/sms_on_rails/service_providers/clickatell.rb', line 32 def (phone_number, , ={}) unique_id = invoke_clickatell{ api.(phone_number, ) } {:unique_id => unique_id} end |