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, context = {}) ⇒ ExampleGateway

Returns a new instance of ExampleGateway.



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

def initialize(mobile_phone_number, code, context = {})
  @mobile_phone_number = mobile_phone_number
  @code = code
  @context = context
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

#contextObject (readonly)

Returns the value of attribute context.



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

def context
  @context
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



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

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