Class: Decidim::Verifications::Sms::ExampleGateway

Inherits:
Object
  • Object
show all
Defined in:
decidim-verifications/lib/decidim/verifications/sms/example_gateway.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(mobile_phone_number, code) ⇒ ExampleGateway

Returns a new instance of ExampleGateway.


9
10
11
12
# File 'decidim-verifications/lib/decidim/verifications/sms/example_gateway.rb', line 9

def initialize(mobile_phone_number, code)
  @mobile_phone_number = mobile_phone_number
  @code = code
end

Instance Attribute Details

#codeObject (readonly)

Returns the value of attribute code


7
8
9
# File 'decidim-verifications/lib/decidim/verifications/sms/example_gateway.rb', line 7

def code
  @code
end

#mobile_phone_numberObject (readonly)

Returns the value of attribute mobile_phone_number


7
8
9
# File 'decidim-verifications/lib/decidim/verifications/sms/example_gateway.rb', line 7

def mobile_phone_number
  @mobile_phone_number
end

Instance Method Details

#deliver_codeObject


14
15
16
17
# File 'decidim-verifications/lib/decidim/verifications/sms/example_gateway.rb', line 14

def deliver_code
  Rails.logger.debug("Example SMS gateway service, verification code is: #{code}, should have been delivered to #{mobile_phone_number}")
  true
end