Class: WorkOS::Challenge
- Inherits:
-
Object
- Object
- WorkOS::Challenge
- Includes:
- HashProvider
- Defined in:
- lib/workos/challenge.rb
Overview
The Challnge class provides a lightweight wrapper around a WorkOS DirectoryUser resource. This class is not meant to be instantiated in DirectoryUser space, and is instantiated internally but exposed.
Instance Attribute Summary collapse
-
#authentication_factor_id ⇒ Object
Returns the value of attribute authentication_factor_id.
-
#code ⇒ Object
Returns the value of attribute code.
-
#created_at ⇒ Object
Returns the value of attribute created_at.
-
#expires_at ⇒ Object
Returns the value of attribute expires_at.
-
#id ⇒ Object
Returns the value of attribute id.
-
#object ⇒ Object
Returns the value of attribute object.
-
#updated_at ⇒ Object
Returns the value of attribute updated_at.
Instance Method Summary collapse
-
#initialize(json) ⇒ Challenge
constructor
A new instance of Challenge.
- #to_json ⇒ Object
Methods included from HashProvider
Constructor Details
#initialize(json) ⇒ Challenge
Returns a new instance of Challenge.
12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/workos/challenge.rb', line 12 def initialize(json) hash = JSON.parse(json, symbolize_names: true) @id = hash[:id] @object = hash[:object] @expires_at = hash[:expires_at] @code = hash[:code] @authentication_factor_id = hash[:authentication_factor_id] @created_at = hash[:created_at] @updated_at = hash[:updated_at] end |
Instance Attribute Details
#authentication_factor_id ⇒ Object
Returns the value of attribute authentication_factor_id.
10 11 12 |
# File 'lib/workos/challenge.rb', line 10 def authentication_factor_id @authentication_factor_id end |
#code ⇒ Object
Returns the value of attribute code.
10 11 12 |
# File 'lib/workos/challenge.rb', line 10 def code @code end |
#created_at ⇒ Object
Returns the value of attribute created_at.
10 11 12 |
# File 'lib/workos/challenge.rb', line 10 def created_at @created_at end |
#expires_at ⇒ Object
Returns the value of attribute expires_at.
10 11 12 |
# File 'lib/workos/challenge.rb', line 10 def expires_at @expires_at end |
#id ⇒ Object
Returns the value of attribute id.
10 11 12 |
# File 'lib/workos/challenge.rb', line 10 def id @id end |
#object ⇒ Object
Returns the value of attribute object.
10 11 12 |
# File 'lib/workos/challenge.rb', line 10 def object @object end |
#updated_at ⇒ Object
Returns the value of attribute updated_at.
10 11 12 |
# File 'lib/workos/challenge.rb', line 10 def updated_at @updated_at end |
Instance Method Details
#to_json ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/workos/challenge.rb', line 24 def to_json(*) { id: id, object: object, expires_at: expires_at, code: code, authentication_factor_id: authentication_factor_id, created_at: created_at, updated_at: updated_at, } end |