Sha256: f8a7c8fe35cfcf7f56c2e41e8dc263df99acb99d2c3703766fe57f319d133435
Contents?: true
Size: 834 Bytes
Versions: 6
Compression:
Stored size: 834 Bytes
Contents
module Rack module OAuth2 class AccessToken include AttrRequired, AttrOptional attr_required :access_token, :token_type attr_optional :refresh_token, :expires_in, :scope def initialize(attributes = {}) (required_attributes + optional_attributes).each do |key| self.send :"#{key}=", attributes[key] end @token_type = self.class.to_s.split('::').last.underscore.to_sym attr_missing! end def token_response(options = {}) { :access_token => access_token, :refresh_token => refresh_token, :token_type => token_type, :expires_in => expires_in, :scope => Array(scope).join(' ') } end end end end require 'rack/oauth2/access_token/bearer' require 'rack/oauth2/access_token/mac'
Version data entries
6 entries across 6 versions & 1 rubygems