Class: WorkOS::AuthenticationFactorAndChallenge
- Inherits:
-
Object
- Object
- WorkOS::AuthenticationFactorAndChallenge
- Includes:
- HashProvider
- Defined in:
- lib/workos/authentication_factor_and_challenge.rb
Overview
The AuthenticationFactorAndChallenge class represents an authentication factor and challenge for a given user.
Instance Attribute Summary collapse
-
#authentication_challenge ⇒ Object
Returns the value of attribute authentication_challenge.
-
#authentication_factor ⇒ Object
Returns the value of attribute authentication_factor.
Instance Method Summary collapse
-
#initialize(authentication_response_json) ⇒ AuthenticationFactorAndChallenge
constructor
A new instance of AuthenticationFactorAndChallenge.
- #to_json ⇒ Object
Methods included from HashProvider
Constructor Details
#initialize(authentication_response_json) ⇒ AuthenticationFactorAndChallenge
Returns a new instance of AuthenticationFactorAndChallenge.
11 12 13 14 15 16 17 18 19 |
# File 'lib/workos/authentication_factor_and_challenge.rb', line 11 def initialize(authentication_response_json) json = JSON.parse(authentication_response_json, symbolize_names: true) @authentication_factor = WorkOS::Factor.new( json[:authentication_factor].to_json, ) @authentication_challenge = WorkOS::Challenge.new( json[:authentication_challenge].to_json, ) end |
Instance Attribute Details
#authentication_challenge ⇒ Object
Returns the value of attribute authentication_challenge.
9 10 11 |
# File 'lib/workos/authentication_factor_and_challenge.rb', line 9 def authentication_challenge @authentication_challenge end |
#authentication_factor ⇒ Object
Returns the value of attribute authentication_factor.
9 10 11 |
# File 'lib/workos/authentication_factor_and_challenge.rb', line 9 def authentication_factor @authentication_factor end |
Instance Method Details
#to_json ⇒ Object
21 22 23 24 25 26 |
# File 'lib/workos/authentication_factor_and_challenge.rb', line 21 def to_json(*) { authentication_factor: authentication_factor.to_json, authentication_challenge: authentication_challenge.to_json, } end |