class GoogleOauth2Installed::AccessToken
Public Instance Methods
access_token()
click to toggle source
# File lib/google-oauth2-installed/access_token.rb, line 6 def access_token token = OAuth2::AccessToken.from_hash(client, token_hash) token.expired? ? token.refresh! : token end
Private Instance Methods
client()
click to toggle source
# File lib/google-oauth2-installed/access_token.rb, line 13 def client @_client ||= OAuth2::Client.new(*oauth2_info) end
oauth2_info()
click to toggle source
# File lib/google-oauth2-installed/access_token.rb, line 17 def oauth2_info credentials.values_at(:oauth2_client_id, :oauth2_client_secret, :oauth2_urls) end
token_hash()
click to toggle source
# File lib/google-oauth2-installed/access_token.rb, line 21 def token_hash credentials[:oauth2_token] end