Class: WorkOS::Factor
- Inherits:
-
Object
- Object
- WorkOS::Factor
- Includes:
- HashProvider
- Defined in:
- lib/workos/factor.rb
Overview
The Factor 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
-
#created_at ⇒ Object
Returns the value of attribute created_at.
-
#id ⇒ Object
Returns the value of attribute id.
-
#object ⇒ Object
Returns the value of attribute object.
-
#sms ⇒ Object
Returns the value of attribute sms.
-
#totp ⇒ Object
Returns the value of attribute totp.
-
#type ⇒ Object
Returns the value of attribute type.
-
#updated_at ⇒ Object
Returns the value of attribute updated_at.
Instance Method Summary collapse
-
#initialize(json) ⇒ Factor
constructor
A new instance of Factor.
- #to_json ⇒ Object
Methods included from HashProvider
Constructor Details
#initialize(json) ⇒ Factor
Returns a new instance of Factor.
11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/workos/factor.rb', line 11 def initialize(json) hash = JSON.parse(json, symbolize_names: true) @id = hash[:id] @object = hash[:object] @type = hash[:type] @created_at = hash[:created_at] @updated_at = hash[:updated_at] @totp = hash[:totp] @sms = hash[:sms] end |
Instance Attribute Details
#created_at ⇒ Object
Returns the value of attribute created_at.
9 10 11 |
# File 'lib/workos/factor.rb', line 9 def created_at @created_at end |
#id ⇒ Object
Returns the value of attribute id.
9 10 11 |
# File 'lib/workos/factor.rb', line 9 def id @id end |
#object ⇒ Object
Returns the value of attribute object.
9 10 11 |
# File 'lib/workos/factor.rb', line 9 def object @object end |
#sms ⇒ Object
Returns the value of attribute sms.
9 10 11 |
# File 'lib/workos/factor.rb', line 9 def sms @sms end |
#totp ⇒ Object
Returns the value of attribute totp.
9 10 11 |
# File 'lib/workos/factor.rb', line 9 def totp @totp end |
#type ⇒ Object
Returns the value of attribute type.
9 10 11 |
# File 'lib/workos/factor.rb', line 9 def type @type end |
#updated_at ⇒ Object
Returns the value of attribute updated_at.
9 10 11 |
# File 'lib/workos/factor.rb', line 9 def updated_at @updated_at end |
Instance Method Details
#to_json ⇒ Object
23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/workos/factor.rb', line 23 def to_json(*) { id: id, object: object, type: type, totp: totp, sms: sms, created_at: created_at, updated_at: updated_at, } end |