Sha256: 60dde351d6a1361108707939bfcc13a1034f456053bb278c630393b1bcf8fb11
Contents?: true
Size: 1.19 KB
Versions: 4
Compression:
Stored size: 1.19 KB
Contents
# frozen_string_literal: true module WorkOS # 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. class Invitation include HashProvider attr_accessor :id, :email, :state, :accepted_at, :revoked_at, :expires_at, :token, :organization_id, :created_at, :updated_at def initialize(json) hash = JSON.parse(json, symbolize_names: true) @id = hash[:id] @email = hash[:email] @state = hash[:state] @token = hash[:token] @organization_id = hash[:organization_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 def to_json(*) { id: id, email: email, state: state, token: token, organization_id: organization_id, accepted_at: accepted_at, revoked_at: revoked_at, expires_at: expires_at, created_at: created_at, updated_at: updated_at, } end end end
Version data entries
4 entries across 4 versions & 1 rubygems
Version | Path |
---|---|
workos-4.4.0 | lib/workos/invitation.rb |
workos-4.3.0 | lib/workos/invitation.rb |
workos-4.2.1 | lib/workos/invitation.rb |
workos-4.2.0 | lib/workos/invitation.rb |