Class | CartItem
In: | app/models/cart_item.rb
Parent: | Object

### Methods

increment_quantity new price title

### Attributes

product | [R] |
quantity | [R] |

### Public Class methods

new(product)

[Source]

       # File app/models/cart_item.rb, line 3
    3:   def initialize(product)
    4:     @product = product
    5:     @quantity = 1
    6:   end

### Public Instance methods

increment_quantity()

[Source]

       # File app/models/cart_item.rb, line 7
    7:   def increment_quantity
    8:     @quantity += 1
    9:   end

price()

[Source]

        # File app/models/cart_item.rb, line 13
    13:   def price
    14:     @product.price * @quantity
    15:   end

title()

[Source]

        # File app/models/cart_item.rb, line 10
    10:   def title
    11:     @product.title
    12:   end

[Validate]