Class: DiasporaClient::AccessToken
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- DiasporaClient::AccessToken
- Defined in:
- lib/diaspora-client/access_token.rb
Instance Method Summary (collapse)
-
- (Integer) expires_in
Unix time until token experation.
-
- (OAuth2::AccessToken) token
Fetches the current or generates a new access token.
Instance Method Details
- (Integer) expires_in
Unix time until token experation.
14 15 16 |
# File 'lib/diaspora-client/access_token.rb', line 14 def expires_in (expires_at - Time.now).to_i end |
- (OAuth2::AccessToken) token
Fetches the current or generates a new access token.
9 10 11 |
# File 'lib/diaspora-client/access_token.rb', line 9 def token @token ||= OAuth2::AccessToken.new(resource_server.client, access_token, refresh_token, expires_in, :adapter => DiasporaClient.which_faraday_adapter?) end |