Sha256: 2e63712c42734afa6aefce94d6efce931177b5c3fd806f8c0d0d4dee89bbbea8
Contents?: true
Size: 786 Bytes
Versions: 22
Compression:
Stored size: 786 Bytes
Contents
# frozen_string_literal: true # typed: true module WorkOS # The ProfileAndToken class represents a Profile and a corresponding # Access Token. This class is not meant to be instantiated in user space, and # is instantiated internally but exposed. class ProfileAndToken include HashProvider extend T::Sig attr_accessor :access_token, :profile sig { params(profile_and_token_json: String).void } def initialize(profile_and_token_json) json = JSON.parse(profile_and_token_json, symbolize_names: true) @access_token = T.let(json[:access_token], String) @profile = WorkOS::Profile.new(json[:profile].to_json) end def to_json(*) { access_token: access_token, profile: profile.to_json, } end end end
Version data entries
22 entries across 22 versions & 1 rubygems