Class: SmsSafe::Interceptors::Nexmo
- Inherits:
-
SmsSafe::Interceptor
- Object
- SmsSafe::Interceptor
- SmsSafe::Interceptors::Nexmo
- Defined in:
- lib/sms_safe/interceptors/nexmo.rb
Instance Method Summary collapse
-
#convert_message(message) ⇒ Message
Converts a hash of params (Nexmo doesn't use a class to represent their messages) into Message.
-
#redirect(message) ⇒ Hash
Returns a modified version of the original message with new recipient and text, to give back to the texter gem to send.
Methods inherited from SmsSafe::Interceptor
#discard, #email, #email_recipient, #intercept_message!, #intercept_message?, #process_message, #redirect_phone_number, #redirect_text
Instance Method Details
#convert_message(message) ⇒ Message
Converts a hash of params (Nexmo doesn't use a class to represent their messages) into Message
14 15 16 |
# File 'lib/sms_safe/interceptors/nexmo.rb', line 14 def () SmsSafe::Message.new(from: [:from], to: [:to], text: [:text], original_message: ) end |
#redirect(message) ⇒ Hash
Returns a modified version of the original message with new recipient and text,
to give back to the texter gem to send.
23 24 25 26 27 28 |
# File 'lib/sms_safe/interceptors/nexmo.rb', line 23 def redirect() = . [:to] = redirect_phone_number() [:text] = redirect_text() end |