Class: SmsSafe::Interceptors::ActionTexter
- Inherits:
-
SmsSafe::Interceptor
- Object
- SmsSafe::Interceptor
- SmsSafe::Interceptors::ActionTexter
- Defined in:
- lib/sms_safe/interceptors/action_texter.rb
Overview
Interceptor class for ActionTexter Gem. Maps ActionTexter::Message into SmsSafe::Message and back.
Instance Method Summary collapse
-
#convert_message(message) ⇒ Message
Converts an ActionTexter::Message into an SmsSafe::Message.
-
#delivering_sms(message) ⇒ ActionTexter::Message
This method will be called differently for each Texter Gem, it’s the one that the hook likes to call In all cases, it’s a one-liner that calls process_message in the superclass It could even be an alias, for all practical purposes.
-
#redirect(message) ⇒ ActionTexter::Message
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
#deliver_email, #discard, #email, #email_body, #email_recipient, #intercept_message!, #intercept_message?, #process_message, #redirect_phone_number, #redirect_text
Instance Method Details
#convert_message(message) ⇒ Message
Converts an ActionTexter::Message into an SmsSafe::Message
17 18 19 |
# File 'lib/sms_safe/interceptors/action_texter.rb', line 17 def () SmsSafe::Message.new(from: .from, to: .to, text: .text, original_message: ) end |
#delivering_sms(message) ⇒ ActionTexter::Message
This method will be called differently for each Texter Gem, it’s the one that the hook likes to call In all cases, it’s a one-liner that calls process_message in the superclass It could even be an alias, for all practical purposes
10 11 12 |
# File 'lib/sms_safe/interceptors/action_texter.rb', line 10 def delivering_sms() self.() end |
#redirect(message) ⇒ ActionTexter::Message
Returns a modified version of the original message with new recipient and text,
to give back to the texter gem to send.
27 28 29 30 31 32 |
# File 'lib/sms_safe/interceptors/action_texter.rb', line 27 def redirect() = . .to = redirect_phone_number() .text = redirect_text() end |