Class: ShopifyTransporter::Exporters::Magento::DatabaseCache

Inherits:
Object
  • Object
show all
Defined in:
lib/shopify_transporter/exporters/magento/database_cache.rb

Constant Summary collapse

DB_CACHE_FOLDER =
'./cache/magento_db'

Instance Method Summary collapse

Constructor Details

#initializeDatabaseCache

Returns a new instance of DatabaseCache.



11
12
13
# File 'lib/shopify_transporter/exporters/magento/database_cache.rb', line 11

def initialize
  @cache = {}
end

Instance Method Details

#table(table_name) ⇒ Object



15
16
17
# File 'lib/shopify_transporter/exporters/magento/database_cache.rb', line 15

def table(table_name)
  @cache[table_name] ||= CSV.read("#{DB_CACHE_FOLDER}/#{table_name}.csv", headers: true)
end