Class: ActiveCart::StorageEngines::Memory

Inherits:
Array
  • Object
show all
Includes:
CartStorage
Defined in:
lib/active_cart/storage_engines/memory.rb

Overview

This storage engine is probably only useful as a reference implementation (It would work in a desktop app I guess). Items only exist in memory, so as soon as the thread dies, so does the cart.

Instance Method Summary collapse

Methods included from CartStorage

#add_to_cart, included, #quantity, #remove_from_cart, #sub_total

Instance Method Details

#invoice_idObject



9
10
11
# File 'lib/active_cart/storage_engines/memory.rb', line 9

def invoice_id
  @@last_id = @@last_id ? @@last_id + 1 : 1
end