Class: Decidim::ActionDelegator::SmsGateway
- Inherits:
-
Object
- Object
- Decidim::ActionDelegator::SmsGateway
- Defined in:
- app/services/decidim/action_delegator/sms_gateway.rb
Constant Summary collapse
- SMS_GATEWAY_PROVIDER_JOBS =
{ som_connexio: SendSmsJob, twilio: TwilioSendSmsJob }.freeze
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#mobile_phone_number ⇒ Object
readonly
Returns the value of attribute mobile_phone_number.
-
#response ⇒ Object
readonly
Returns the value of attribute response.
Instance Method Summary collapse
- #deliver_code ⇒ Object
-
#initialize(mobile_phone_number, code) ⇒ SmsGateway
constructor
A new instance of SmsGateway.
Constructor Details
#initialize(mobile_phone_number, code) ⇒ SmsGateway
Returns a new instance of SmsGateway.
13 14 15 16 |
# File 'app/services/decidim/action_delegator/sms_gateway.rb', line 13 def initialize(mobile_phone_number, code) @mobile_phone_number = mobile_phone_number @code = code end |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code.
6 7 8 |
# File 'app/services/decidim/action_delegator/sms_gateway.rb', line 6 def code @code end |
#mobile_phone_number ⇒ Object (readonly)
Returns the value of attribute mobile_phone_number.
6 7 8 |
# File 'app/services/decidim/action_delegator/sms_gateway.rb', line 6 def mobile_phone_number @mobile_phone_number end |
#response ⇒ Object (readonly)
Returns the value of attribute response.
6 7 8 |
# File 'app/services/decidim/action_delegator/sms_gateway.rb', line 6 def response @response end |
Instance Method Details
#deliver_code ⇒ Object
18 19 20 21 22 23 24 |
# File 'app/services/decidim/action_delegator/sms_gateway.rb', line 18 def deliver_code return false unless sms_gateway_provider_valid? sms_gateway_job.perform_later(sender, mobile_phone_number, ) true end |