Class: GoogleSpreadsheets::Auth::ServiceAccountsAccessToken
- Inherits:
-
Object
- Object
- GoogleSpreadsheets::Auth::ServiceAccountsAccessToken
- Defined in:
- lib/google_spreadsheets/auth/service_accounts_access_token.rb
Instance Method Summary collapse
- #call(connection) ⇒ Object
-
#initialize(options = {}) ⇒ ServiceAccountsAccessToken
constructor
A new instance of ServiceAccountsAccessToken.
Constructor Details
#initialize(options = {}) ⇒ ServiceAccountsAccessToken
Returns a new instance of ServiceAccountsAccessToken.
6 7 8 9 |
# File 'lib/google_spreadsheets/auth/service_accounts_access_token.rb', line 6 def initialize( = {}) = [:scope] ||= 'https://spreadsheets.google.com/feeds/' end |
Instance Method Details
#call(connection) ⇒ Object
11 12 13 14 15 |
# File 'lib/google_spreadsheets/auth/service_accounts_access_token.rb', line 11 def call(connection) ||= Google::Auth::ServiceAccountCredentials.make_creds() .refresh! if .expires_at.nil? || .expired? .access_token end |