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