Class: GoogleDrive::AccessTokenCredentials Private

Inherits:
Object
  • Object
show all
Defined in:
lib/google_drive/access_token_credentials.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

A simple credentials class using an existing OAuth2 access_token.

Based on: github.com/google/google-api-ruby-client/issues/296

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(access_token) ⇒ AccessTokenCredentials

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of AccessTokenCredentials.



11
12
13
# File 'lib/google_drive/access_token_credentials.rb', line 11

def initialize(access_token)
  @access_token = access_token
end

Instance Attribute Details

#access_tokenObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



9
10
11
# File 'lib/google_drive/access_token_credentials.rb', line 9

def access_token
  @access_token
end

Instance Method Details

#apply!(headers) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



15
16
17
# File 'lib/google_drive/access_token_credentials.rb', line 15

def apply!(headers)
  headers['Authorization'] = "Bearer #{@access_token}"
end