Class: C2eCore::Drops::UsersConfirmationCodeDrop
- Defined in:
- /build/app/mailers/c2e_core/drops/users_confirmation_code_drop.rb
Instance Method Summary collapse
-
#autofill ⇒ String
-
SMS OTP autofill standard format.
-
-
#expires_at ⇒ String
-
Time after which the ConfirmationCode is no longer accepted.
-
-
#initialize(confirmation_code) ⇒ UsersConfirmationCodeDrop
constructor
A new instance of UsersConfirmationCodeDrop.
-
#resource ⇒ String
-
The resource that the User is confirming.
-
-
#url ⇒ String?
-
Link to confirm the user’s email.
-
-
#value ⇒ String
-
Value of the ConfirmationCode.
-
Constructor Details
#initialize(confirmation_code) ⇒ UsersConfirmationCodeDrop
Returns a new instance of UsersConfirmationCodeDrop.
6 7 8 9 |
# File '/build/app/mailers/c2e_core/drops/users_confirmation_code_drop.rb', line 6 def initialize(confirmation_code) super() @confirmation_code = confirmation_code end |
Instance Method Details
#autofill ⇒ String
Returns - SMS OTP autofill standard format. E.g.: “@consents.stage.speedlo.cloud #123456”. Must appear on the last line of the SMS, see: web.dev/web-otp/#format.
28 29 30 31 |
# File '/build/app/mailers/c2e_core/drops/users_confirmation_code_drop.rb', line 28 def autofill host = @confirmation_code.originator_host.presence || "speedlo.cz" "@#{host} ##{@confirmation_code.value}" end |
#expires_at ⇒ String
Returns - Time after which the ConfirmationCode is no longer accepted. E.g.: “11:38:56 CET”.
22 23 24 |
# File '/build/app/mailers/c2e_core/drops/users_confirmation_code_drop.rb', line 22 def expires_at @confirmation_code.expires_at_time_with_zone end |
#resource ⇒ String
Returns - The resource that the User is confirming. E.g.: “test@example.com” or “+420333123456”.
17 18 19 |
# File '/build/app/mailers/c2e_core/drops/users_confirmation_code_drop.rb', line 17 def resource @confirmation_code.formatted_resource end |
#url ⇒ String?
Returns - Link to confirm the user’s email.
34 35 36 |
# File '/build/app/mailers/c2e_core/drops/users_confirmation_code_drop.rb', line 34 def url @confirmation_code.return_url end |
#value ⇒ String
Returns - Value of the ConfirmationCode. E.g.: “123456”.
12 13 14 |
# File '/build/app/mailers/c2e_core/drops/users_confirmation_code_drop.rb', line 12 def value @confirmation_code.value end |