Class: AspireBudget::Configuration
- Inherits:
-
Object
- Object
- AspireBudget::Configuration
- Defined in:
- lib/aspire_budget/configuration.rb
Instance Attribute Summary collapse
-
#session ⇒ GoogleDrive::Session
Authenticated GoogleDrive session.
-
#spreadsheet_key ⇒ String
Google spreadsheet key (as it is in the url).
Instance Method Summary collapse
-
#agent(session = nil, spreadsheet_key = nil) ⇒ GoogleDrive::Spreadsheet
Build an agent using given
session
andspreadsheet_key
(falling back to the configured ones).
Instance Attribute Details
#session ⇒ GoogleDrive::Session
Authenticated GoogleDrive session
28 29 30 |
# File 'lib/aspire_budget/configuration.rb', line 28 def session @session end |
#spreadsheet_key ⇒ String
Google spreadsheet key (as it is in the url)
32 33 34 |
# File 'lib/aspire_budget/configuration.rb', line 32 def spreadsheet_key @spreadsheet_key end |
Instance Method Details
#agent(session = nil, spreadsheet_key = nil) ⇒ GoogleDrive::Spreadsheet
Build an agent using given session
and spreadsheet_key
(falling back to the configured ones).
41 42 43 44 45 46 47 48 |
# File 'lib/aspire_budget/configuration.rb', line 41 def agent(session = nil, spreadsheet_key = nil) @agents ||= Hash.new do |h, k| h[k] = k.first.spreadsheet_by_key(k.last) end @agents[ [session || self.session, spreadsheet_key || self.spreadsheet_key] ] end |