Class: UndriveGoogle::Session

Inherits:
Object
  • Object
show all
Includes:
Singleton
Defined in:
lib/undrive_google/session.rb

Overview

A Google Drive Session

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeSession

Returns a new instance of Session.



10
11
12
13
# File 'lib/undrive_google/session.rb', line 10

def initialize
  @drive_session = GoogleDrive::Session.(Options.instance.key_file)
  raise UndriveGoogle::Error, "no file_id" unless Options.instance.file_id
end

Instance Attribute Details

#drive_sessionObject (readonly)

Returns the value of attribute drive_session.



8
9
10
# File 'lib/undrive_google/session.rb', line 8

def drive_session
  @drive_session
end

Instance Method Details

#fileObject



15
16
17
# File 'lib/undrive_google/session.rb', line 15

def file
  @file ||= drive_session.send(file_by, Options.instance.file_id)
end