lib/active_sms/backend/base.rb in active_sms-0.2.0 vs lib/active_sms/backend/base.rb in active_sms-0.2.1
- old
+ new
@@ -5,27 +5,34 @@
class Base
# In initializer you may
# accept secrets which were defined in initializer
# or other configuration options if any.
#
- # @params [Hash] List of arguments received from configure code.
+ # @param params [Hash] List of arguments received from configure code.
def initialize(params = {})
end
# Interface for sending sms.
# Every subclass should implement method itself.
# Raises error in default implementation.
#
- # @_phone [String] Phone number to send sms (not used in this implementation)
- # @_text [String] Sms text (not used in this implementation)
+ # @param _phone [String] Phone number to send sms (not used in this implementation)
+ # @param _text [String] Sms text (not used in this implementation)
def send_sms(_phone, _text)
raise NotImplementedError,
"You should create your own class for every sms service you use"
end
protected
- def respond_with_status(status)
- ActiveSMS::Response.new(status: status)
+ # Returns ActiveSMS::Reponse object with status and meta
+ #
+ # @param status [Symbol]
+ # Query status, any other than :success considered as failure
+ # @param meta [Hash]
+ # Optional metadata you can return from api or implementation
+ # @return [ActiveSMS::Reponse] Response object with meta and status
+ def respond_with_status(status, meta: nil)
+ ActiveSMS::Response.new(status: status, meta: meta)
end
end
end