Class: WorkOS::Connection
- Inherits:
-
Object
- Object
- WorkOS::Connection
- Extended by:
- T::Sig
- 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.
Instance Attribute Summary collapse
-
#connection_type ⇒ Object
Returns the value of attribute connection_type.
-
#domains ⇒ Object
Returns the value of attribute domains.
-
#id ⇒ Object
Returns the value of attribute id.
-
#name ⇒ Object
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(json) ⇒ Connection
constructor
A new instance of Connection.
- #to_json ⇒ Object
Constructor Details
#initialize(json) ⇒ Connection
Returns a new instance of Connection.
16 17 18 19 20 21 22 23 |
# File 'lib/workos/connection.rb', line 16 def initialize(json) raw = parse_json(json) @id = T.let(raw.id, String) @name = T.let(raw.name, String) @connection_type = T.let(raw.connection_type, String) @domains = T.let(raw.domains, Array) end |
Instance Attribute Details
#connection_type ⇒ Object
Returns the value of attribute connection_type.
13 14 15 |
# File 'lib/workos/connection.rb', line 13 def connection_type @connection_type end |
#domains ⇒ Object
Returns the value of attribute domains.
13 14 15 |
# File 'lib/workos/connection.rb', line 13 def domains @domains end |
#id ⇒ Object
Returns the value of attribute id.
13 14 15 |
# File 'lib/workos/connection.rb', line 13 def id @id end |
#name ⇒ Object
Returns the value of attribute name.
13 14 15 |
# File 'lib/workos/connection.rb', line 13 def name @name end |
Instance Method Details
#to_json ⇒ Object
25 26 27 28 29 30 31 32 |
# File 'lib/workos/connection.rb', line 25 def to_json(*) { id: id, name: name, connection_type: connection_type, domains: domains, } end |