Class: Ravelin::AuthenticationMechanisms::SmsCode
- Inherits:
-
RavelinObject
- Object
- RavelinObject
- Ravelin::AuthenticationMechanisms::SmsCode
- Defined in:
- lib/ravelin/authentication_mechanisms/sms_code.rb
Constant Summary collapse
- FAILURE_REASONS =
%w(INVALID_CODE CODE_TIMEOUT INTERNAL_ERROR RATE_LIMIT BANNED_USER AUTHENTICATION_FAILURE)
Instance Attribute Summary collapse
-
#failure_reason ⇒ Object
Returns the value of attribute failure_reason.
-
#phone_number ⇒ Object
Returns the value of attribute phone_number.
-
#success ⇒ Object
Returns the value of attribute success.
Instance Method Summary collapse
Methods inherited from RavelinObject
attr_accessor, attr_required, #initialize, required_attributes, #serializable_hash
Constructor Details
This class inherits a constructor from Ravelin::RavelinObject
Instance Attribute Details
#failure_reason ⇒ Object
Returns the value of attribute failure_reason.
6 7 8 |
# File 'lib/ravelin/authentication_mechanisms/sms_code.rb', line 6 def failure_reason @failure_reason end |
#phone_number ⇒ Object
Returns the value of attribute phone_number.
6 7 8 |
# File 'lib/ravelin/authentication_mechanisms/sms_code.rb', line 6 def phone_number @phone_number end |
#success ⇒ Object
Returns the value of attribute success.
6 7 8 |
# File 'lib/ravelin/authentication_mechanisms/sms_code.rb', line 6 def success @success end |
Instance Method Details
#validate ⇒ Object
13 14 15 16 17 18 19 |
# File 'lib/ravelin/authentication_mechanisms/sms_code.rb', line 13 def validate super if !success && !FAILURE_REASONS.include?(failure_reason) raise ArgumentError.new("Failure reason value must be one of #{FAILURE_REASONS.join(', ')}") end end |