module GoogleDrive

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”

Author: Hiroshi Ichikawa <gimite.net/> The license of this source is “New BSD Licence”

Constants

Folder

Represents a folder in Google Drive.

Use GoogleDrive::Session#root_collection, GoogleDrive::Collection#subcollections, or GoogleDrive::Session#collection_by_url to get GoogleDrive::Collection object.

Public Class Methods

login_with_oauth(client_or_access_token, proxy = nil) click to toggle source

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

# File lib/google_drive.rb, line 12
def self.login_with_oauth(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 ) click to toggle source

Alias of GoogleDrive::Session.from_config.

# 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