Class: Spree::LineItemDrop
- Inherits:
-
Clot::BaseDrop
- Object
- Clot::BaseDrop
- Spree::LineItemDrop
- Defined in:
- app/liquid/drops/line_item_drop.rb
Instance Method Summary collapse
- #adjust_quantity ⇒ Object
- #amount ⇒ Object
- #copy_price ⇒ Object
- #decrement_quantity ⇒ Object
- #display_amount ⇒ Object
- #increment_quantity ⇒ Object
- #single_money ⇒ Object
- #total_amount ⇒ Object
- #variant ⇒ Object
Instance Method Details
#adjust_quantity ⇒ Object
25 26 27 |
# File 'app/liquid/drops/line_item_drop.rb', line 25 def adjust_quantity @source.quantity = 0 if @source.quantity.nil? || @source.quantity < 0 end |
#amount ⇒ Object
17 18 19 |
# File 'app/liquid/drops/line_item_drop.rb', line 17 def amount @source.price * @source.quantity end |
#copy_price ⇒ Object
29 30 31 |
# File 'app/liquid/drops/line_item_drop.rb', line 29 def copy_price @source.price = @source.variant.price if @source.variant && @source.price.nil? end |
#decrement_quantity ⇒ Object
13 14 15 |
# File 'app/liquid/drops/line_item_drop.rb', line 13 def decrement_quantity @source.quantity -= 1 end |
#display_amount ⇒ Object
37 38 39 |
# File 'app/liquid/drops/line_item_drop.rb', line 37 def display_amount @source.display_amount end |
#increment_quantity ⇒ Object
9 10 11 |
# File 'app/liquid/drops/line_item_drop.rb', line 9 def increment_quantity @source.quantity += 1 end |
#single_money ⇒ Object
33 34 35 |
# File 'app/liquid/drops/line_item_drop.rb', line 33 def single_money @source.single_money end |
#total_amount ⇒ Object
21 22 23 |
# File 'app/liquid/drops/line_item_drop.rb', line 21 def total_amount amount end |
#variant ⇒ Object
5 6 7 |
# File 'app/liquid/drops/line_item_drop.rb', line 5 def variant @source.variant end |