Sha256: 8731d5d3343708709546620dcf60f3a73c9aa22bbc634c48fafd1f100078a079
Contents?: true
Size: 596 Bytes
Versions: 25
Compression:
Stored size: 596 Bytes
Contents
module ResoTransport module Authentication # Session class for TokenAuth. This stores the access token, the token type # (usually `Bearer`), and the expiration date of the token. class Access attr_accessor :access_token, :expires, :token_type def initialize(options = {}) @access_token = options[:access_token] @expires = Time.now + options[:expires_in] @token_type = options[:token_type] end def expired? Time.now > expires end def valid? !!access_token && !expired? end end end end
Version data entries
25 entries across 25 versions & 1 rubygems