Class: UndriveGoogle::Session
- Inherits:
-
Object
- Object
- UndriveGoogle::Session
- Includes:
- Singleton
- Defined in:
- lib/undrive_google/session.rb
Overview
A Google Drive Session
Instance Attribute Summary collapse
-
#drive_session ⇒ Object
readonly
Returns the value of attribute drive_session.
Instance Method Summary collapse
- #file ⇒ Object
-
#initialize ⇒ Session
constructor
A new instance of Session.
Constructor Details
#initialize ⇒ Session
Returns a new instance of Session.
10 11 12 13 |
# File 'lib/undrive_google/session.rb', line 10 def initialize @drive_session = GoogleDrive::Session.from_service_account_key(Options.instance.key_file) raise UndriveGoogle::Error, "no file_id" unless Options.instance.file_id end |
Instance Attribute Details
#drive_session ⇒ Object (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
#file ⇒ Object
15 16 17 |
# File 'lib/undrive_google/session.rb', line 15 def file @file ||= drive_session.send(file_by, Options.instance.file_id) end |