Module: GoogleDrive

Defined in:
lib/google_drive/error.rb,
lib/google_drive.rb,
lib/google_drive/acl.rb,
lib/google_drive/file.rb,
lib/google_drive/list.rb,
lib/google_drive/util.rb,
lib/google_drive/config.rb,
lib/google_drive/session.rb,
lib/google_drive/list_row.rb,
lib/google_drive/acl_entry.rb,
lib/google_drive/worksheet.rb,
lib/google_drive/collection.rb,
lib/google_drive/spreadsheet.rb,
lib/google_drive/api_client_fetcher.rb,
lib/google_drive/response_code_error.rb,
lib/google_drive/authentication_error.rb,
lib/google_drive/access_token_credentials.rb

Overview

Author: Guy Boertje <github.com/guyboertje> Author: David R. Albrecht <github.com/eldavido> Author: Hiroshi Ichikawa <gimite.net/> Author: Phuogn Nguyen <github.com/phuongnd08> The license of this source is “New BSD Licence”

Defined Under Namespace

Modules: Util Classes: AccessTokenCredentials, Acl, AclEntry, ApiClientFetcher, AuthenticationError, Collection, Config, Error, File, List, ListRow, ResponseCodeError, Session, Spreadsheet, Worksheet

Constant Summary collapse

Folder =
Collection

Class Method Summary collapse

Class Method Details

.login_with_oauth(client_or_access_token, proxy = nil) ⇒ Object

Equivalent of either GoogleDrive::Session.from_credentials or GoogleDrive::Session.from_access_token.



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

def self.(client_or_access_token, proxy = nil)
  Session.new(client_or_access_token, proxy)
end

.saved_session(config = ENV['HOME'] + '/.ruby_google_drive.token', proxy = nil, client_id = nil, client_secret = nil) ⇒ Object

Alias of GoogleDrive::Session.from_config.



17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/google_drive.rb', line 17

def self.saved_session(
    config = ENV['HOME'] + '/.ruby_google_drive.token',
    proxy = nil,
    client_id = nil,
    client_secret = nil
)
  if proxy
    raise(
      ArgumentError,
      'Specifying a proxy object is no longer supported. ' \
      'Set ENV["http_proxy"] instead.'
    )
  end

  Session.from_config(
    config, client_id: client_id, client_secret: client_secret
  )
end