Class: SpreadsheetCacheManager
- Inherits:
-
Object
- Object
- SpreadsheetCacheManager
- Defined in:
- lib/spreadsheet_cache_manager_refi.rb
Instance Method Summary collapse
- #get_ss_db_cache(ss_pn, p = {}) ⇒ Object
-
#initialize(p = {}) ⇒ SpreadsheetCacheManager
constructor
A new instance of SpreadsheetCacheManager.
Constructor Details
#initialize(p = {}) ⇒ SpreadsheetCacheManager
Returns a new instance of SpreadsheetCacheManager.
8 9 10 11 12 |
# File 'lib/spreadsheet_cache_manager_refi.rb', line 8 def initialize(p={}) @default_db_pa = p[:default_db_pa] || "./" @ss_manager = p[:ss_manager] || SpreadsheetManager.new @ss_db_cache_s = {} # ss_pn => ss_db_cache end |
Instance Method Details
#get_ss_db_cache(ss_pn, p = {}) ⇒ Object
13 14 15 16 17 18 19 20 21 |
# File 'lib/spreadsheet_cache_manager_refi.rb', line 13 def get_ss_db_cache(ss_pn,p={}) db_pn = p[:db_pn] || File.join( @default_db_pa , "#{File.basename(ss_pn)}.ssdb" ) if @ss_db_cache_s[ss_pn] == nil # spreadsheet cache db not opened yet #myreq "intern/ss_db_cache.rb" ss_db_cache = SpreadsheetCache.new(db_pn,ss_pn,@ss_manager) @ss_db_cache_s[ss_pn] = ss_db_cache end return @ss_db_cache_s[ss_pn] end |