Module: ActiveCart::Item
- Included in:
- ActiveCart::Items::MemoryItem
- Defined in:
- lib/active_cart/item.rb
Instance Method Summary (collapse)
-
- (Object) id
A unique id for the item.
-
- (Object) name
A display name for the item.
-
- (Object) price
Returns the price of this item.
-
- (Object) quantity
Returns the quantity of this item in the context of a cart.
-
- (Object) quantity=(quantity)
Set the quantity of this item in the context of a cart.
Instance Method Details
- (Object) id
A unique id for the item. The Mixee needs to implement this or a NotImplementedError will be thrown
8 9 10 |
# File 'lib/active_cart/item.rb', line 8 def id raise NotImplementedError end |
- (Object) name
A display name for the item. The Mixee needs to implement this or a NotImplementedError will be thrown
14 15 16 |
# File 'lib/active_cart/item.rb', line 14 def name raise NotImplementedError end |
- (Object) price
Returns the price of this item
32 33 34 |
# File 'lib/active_cart/item.rb', line 32 def price raise NotImplementedError end |
- (Object) quantity
Returns the quantity of this item in the context of a cart
20 21 22 |
# File 'lib/active_cart/item.rb', line 20 def quantity @quantity || 0 end |
- (Object) quantity=(quantity)
Set the quantity of this item in the context of a cart
26 27 28 |
# File 'lib/active_cart/item.rb', line 26 def quantity=(quantity) @quantity = quantity end |