Class: WorkOS::OrganizationMembership
- Inherits:
-
Object
- Object
- WorkOS::OrganizationMembership
- Includes:
- HashProvider
- Defined in:
- lib/workos/organization_membership.rb
Overview
The OrganizationMembership class provides a lightweight wrapper around a WorkOS OrganizationMembership resource. This class is not meant to be instantiated in a user 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.
-
#organization_id ⇒ Object
Returns the value of attribute organization_id.
-
#role ⇒ Object
Returns the value of attribute role.
-
#status ⇒ Object
Returns the value of attribute status.
-
#updated_at ⇒ Object
Returns the value of attribute updated_at.
-
#user_id ⇒ Object
Returns the value of attribute user_id.
Instance Method Summary collapse
-
#initialize(json) ⇒ OrganizationMembership
constructor
A new instance of OrganizationMembership.
- #to_json ⇒ Object
Methods included from HashProvider
Constructor Details
#initialize(json) ⇒ OrganizationMembership
Returns a new instance of OrganizationMembership.
12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/workos/organization_membership.rb', line 12 def initialize(json) hash = JSON.parse(json, symbolize_names: true) @id = hash[:id] @user_id = hash[:user_id] @organization_id = hash[:organization_id] @status = hash[:status] @role = hash[:role] @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/organization_membership.rb', line 10 def created_at @created_at end |
#id ⇒ Object
Returns the value of attribute id.
10 11 12 |
# File 'lib/workos/organization_membership.rb', line 10 def id @id end |
#organization_id ⇒ Object
Returns the value of attribute organization_id.
10 11 12 |
# File 'lib/workos/organization_membership.rb', line 10 def organization_id @organization_id end |
#role ⇒ Object
Returns the value of attribute role.
10 11 12 |
# File 'lib/workos/organization_membership.rb', line 10 def role @role end |
#status ⇒ Object
Returns the value of attribute status.
10 11 12 |
# File 'lib/workos/organization_membership.rb', line 10 def status @status end |
#updated_at ⇒ Object
Returns the value of attribute updated_at.
10 11 12 |
# File 'lib/workos/organization_membership.rb', line 10 def updated_at @updated_at end |
#user_id ⇒ Object
Returns the value of attribute user_id.
10 11 12 |
# File 'lib/workos/organization_membership.rb', line 10 def user_id @user_id end |
Instance Method Details
#to_json ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/workos/organization_membership.rb', line 24 def to_json(*) { id: id, user_id: user_id, organization_id: organization_id, status: status, role: role, created_at: created_at, updated_at: updated_at, } end |