Class: ShopifyTransporter::Exporters::Magento::DatabaseCache
- Inherits:
-
Object
- Object
- ShopifyTransporter::Exporters::Magento::DatabaseCache
- Defined in:
- lib/shopify_transporter/exporters/magento/database_cache.rb
Constant Summary collapse
- DB_CACHE_FOLDER =
'./cache/magento_db'
Instance Method Summary collapse
-
#initialize ⇒ DatabaseCache
constructor
A new instance of DatabaseCache.
- #table(table_name) ⇒ Object
Constructor Details
#initialize ⇒ DatabaseCache
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 |