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