Class: WorkOS::Invitation
- Inherits:
-
Object
- Object
- WorkOS::Invitation
- Includes:
- HashProvider
- Defined in:
- lib/workos/invitation.rb
Overview
The Invitation class provides a lightweight wrapper around a WorkOS Invitation resource. This class is not meant to be instantiated in a user space, and is instantiated internally but exposed.
Instance Attribute Summary collapse
-
#accept_invitation_url ⇒ Object
Returns the value of attribute accept_invitation_url.
-
#accepted_at ⇒ Object
Returns the value of attribute accepted_at.
-
#created_at ⇒ Object
Returns the value of attribute created_at.
-
#email ⇒ Object
Returns the value of attribute email.
-
#expires_at ⇒ Object
Returns the value of attribute expires_at.
-
#id ⇒ Object
Returns the value of attribute id.
-
#inviter_user_id ⇒ Object
Returns the value of attribute inviter_user_id.
-
#organization_id ⇒ Object
Returns the value of attribute organization_id.
-
#revoked_at ⇒ Object
Returns the value of attribute revoked_at.
-
#state ⇒ Object
Returns the value of attribute state.
-
#token ⇒ Object
Returns the value of attribute token.
-
#updated_at ⇒ Object
Returns the value of attribute updated_at.
Instance Method Summary collapse
-
#initialize(json) ⇒ Invitation
constructor
rubocop:disable Metrics/AbcSize.
-
#to_json ⇒ Object
rubocop:enable Metrics/AbcSize.
Methods included from HashProvider
Constructor Details
#initialize(json) ⇒ Invitation
rubocop:disable Metrics/AbcSize
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/workos/invitation.rb', line 14 def initialize(json) hash = JSON.parse(json, symbolize_names: true) @id = hash[:id] @email = hash[:email] @state = hash[:state] @token = hash[:token] @accept_invitation_url = hash[:accept_invitation_url] @organization_id = hash[:organization_id] @inviter_user_id = hash[:inviter_user_id] @accepted_at = hash[:accepted_at] @revoked_at = hash[:revoked_at] @expires_at = hash[:expires_at] @created_at = hash[:created_at] @updated_at = hash[:updated_at] end |
Instance Attribute Details
#accept_invitation_url ⇒ Object
Returns the value of attribute accept_invitation_url.
10 11 12 |
# File 'lib/workos/invitation.rb', line 10 def accept_invitation_url @accept_invitation_url end |
#accepted_at ⇒ Object
Returns the value of attribute accepted_at.
10 11 12 |
# File 'lib/workos/invitation.rb', line 10 def accepted_at @accepted_at end |
#created_at ⇒ Object
Returns the value of attribute created_at.
10 11 12 |
# File 'lib/workos/invitation.rb', line 10 def created_at @created_at end |
#email ⇒ Object
Returns the value of attribute email.
10 11 12 |
# File 'lib/workos/invitation.rb', line 10 def email @email end |
#expires_at ⇒ Object
Returns the value of attribute expires_at.
10 11 12 |
# File 'lib/workos/invitation.rb', line 10 def expires_at @expires_at end |
#id ⇒ Object
Returns the value of attribute id.
10 11 12 |
# File 'lib/workos/invitation.rb', line 10 def id @id end |
#inviter_user_id ⇒ Object
Returns the value of attribute inviter_user_id.
10 11 12 |
# File 'lib/workos/invitation.rb', line 10 def inviter_user_id @inviter_user_id end |
#organization_id ⇒ Object
Returns the value of attribute organization_id.
10 11 12 |
# File 'lib/workos/invitation.rb', line 10 def organization_id @organization_id end |
#revoked_at ⇒ Object
Returns the value of attribute revoked_at.
10 11 12 |
# File 'lib/workos/invitation.rb', line 10 def revoked_at @revoked_at end |
#state ⇒ Object
Returns the value of attribute state.
10 11 12 |
# File 'lib/workos/invitation.rb', line 10 def state @state end |
#token ⇒ Object
Returns the value of attribute token.
10 11 12 |
# File 'lib/workos/invitation.rb', line 10 def token @token end |
#updated_at ⇒ Object
Returns the value of attribute updated_at.
10 11 12 |
# File 'lib/workos/invitation.rb', line 10 def updated_at @updated_at end |
Instance Method Details
#to_json ⇒ Object
rubocop:enable Metrics/AbcSize
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/workos/invitation.rb', line 32 def to_json(*) { id: id, email: email, state: state, token: token, accept_invitation_url: accept_invitation_url, organization_id: organization_id, inviter_user_id: inviter_user_id, accepted_at: accepted_at, revoked_at: revoked_at, expires_at: expires_at, created_at: created_at, updated_at: updated_at, } end |