class SMSWay::Base
Represents a client API
All API classes must inherit from this class, and be saved in lib/deliverers directory.
Public Class Methods
inherited(subclass)
click to toggle source
# File lib/sms_way/base.rb, line 9 def self.inherited(subclass) subclass.class_eval { include APISmith::Client include SMSWay::Registry } end
new(auth_options)
click to toggle source
# File lib/sms_way/base.rb, line 16 def initialize(auth_options) add_query_options! auth_options end
Public Instance Methods
send_sms(to, text, api_options = {})
click to toggle source
Implement this method in your client implementation.
Sends a SMS message to clients specified in to
param.
Required parameters¶ ↑
-
to
- An array with destination addresses -
text
- The message text.
Optional parameters¶ ↑
-
api_options
An hash with any optional or specific API parameters
# File lib/sms_way/base.rb, line 30 def send_sms(to, text, api_options = {}) raise NotImplementedError.new('Implement send_sms(to, text, api_options = {}) in your client.') end
Private Instance Methods
base_query_options()
click to toggle source
# File lib/sms_way/base.rb, line 36 def base_query_options SMSWay::Config.base_options_of(self.class.to_s) end