Class: Sp2db::Client
Instance Attribute Summary collapse
-
#credential ⇒ Object
Returns the value of attribute credential.
-
#session ⇒ Object
Returns the value of attribute session.
Attributes included from Logging
Instance Method Summary collapse
- #config ⇒ Object
-
#initialize ⇒ Client
constructor
A new instance of Client.
- #saved_session ⇒ Object
- #spreadsheet(sid) ⇒ Object
Methods included from Logging
Constructor Details
#initialize ⇒ Client
Returns a new instance of Client.
8 9 10 |
# File 'lib/sp2db/client.rb', line 8 def initialize end |
Instance Attribute Details
#credential ⇒ Object
Returns the value of attribute credential.
6 7 8 |
# File 'lib/sp2db/client.rb', line 6 def credential @credential end |
#session ⇒ Object
Returns the value of attribute session.
6 7 8 |
# File 'lib/sp2db/client.rb', line 6 def session @session end |
Instance Method Details
#saved_session ⇒ Object
43 44 45 46 47 48 49 |
# File 'lib/sp2db/client.rb', line 43 def saved_session logger.debug "Use saved session" GoogleDrive.saved_session Sp2db.config.personal_credential, nil, client_id: config.client_id, client_secret: config.client_secret end |
#spreadsheet(sid) ⇒ Object
51 52 53 |
# File 'lib/sp2db/client.rb', line 51 def spreadsheet sid Spreadsheet.new session.spreadsheet_by_key(sid) end |