Class: Dugway::Drops::CartItemDrop
- Inherits:
-
BaseDrop
- Object
- Liquid::Drop
- BaseDrop
- Dugway::Drops::CartItemDrop
show all
- Defined in:
- lib/dugway/liquid/drops/cart_item_drop.rb
Instance Attribute Summary
Attributes inherited from BaseDrop
#params, #request, #source
Instance Method Summary
collapse
Methods inherited from BaseDrop
#before_method, #cart, #context=, #error, #errors, #initialize, #method_missing, #store, #theme
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
in the class Dugway::Drops::BaseDrop
Instance Method Details
#option ⇒ Object
16
17
18
|
# File 'lib/dugway/liquid/drops/cart_item_drop.rb', line 16
def option
ProductOptionDrop.new(source['option'])
end
|
#price ⇒ Object
4
5
6
|
# File 'lib/dugway/liquid/drops/cart_item_drop.rb', line 4
def price
unit_price * quantity
end
|
#product ⇒ Object
12
13
14
|
# File 'lib/dugway/liquid/drops/cart_item_drop.rb', line 12
def product
ProductDrop.new(source['product'])
end
|
#shipping ⇒ Object
20
21
22
|
# File 'lib/dugway/liquid/drops/cart_item_drop.rb', line 20
def shipping
0.0
end
|
#total ⇒ Object
8
9
10
|
# File 'lib/dugway/liquid/drops/cart_item_drop.rb', line 8
def total
price + shipping
end
|