class AspireBudget::Configuration
Attributes
session[RW]
Authenticated GoogleDrive session @return [GoogleDrive::Session]
spreadsheet_key[RW]
Google spreadsheet key (as it is in the url) @return [String]
Public Instance Methods
agent(session = nil, spreadsheet_key = nil)
click to toggle source
Build an agent using given session
and spreadsheet_key
(falling back to the configured ones). @return [GoogleDrive::Spreadsheet] an spreadsheet agent @param session [GoogleDrive::Session] will fallback to configured one if
not defined
@param spreadsheet_key
[String] will fallback to configured one if not
defined
# 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