class Rack::OAuth2::AccessToken
Attributes
raw_attributes[RW]
Public Class Methods
new(attributes = {})
click to toggle source
# File lib/rack/oauth2/access_token.rb, line 12 def initialize(attributes = {}) (required_attributes + optional_attributes).each do |key| self.send :"#{key}=", attributes[key] end @raw_attributes = attributes @token_type = self.class.name.demodulize.underscore.to_sym attr_missing! end
Public Instance Methods
http_client()
click to toggle source
# File lib/rack/oauth2/access_token.rb, line 21 def http_client @http_client ||= Rack::OAuth2.http_client("#{self.class} (#{VERSION})") do |faraday| Authenticator.new(self).authenticate(faraday) end end
token_response(options = {})
click to toggle source
# File lib/rack/oauth2/access_token.rb, line 27 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