Class: Comable::CartOwner::Cart
- Inherits:
-
Array
- Object
- Array
- Comable::CartOwner::Cart
- Defined in:
- app/models/concerns/comable/cart_owner.rb
Instance Method Summary collapse
- #count ⇒ Object (also: #size)
-
#errors ⇒ Object
TODO: Refactoring.
- #price ⇒ Object
Instance Method Details
#count ⇒ Object Also known as: size
36 37 38 |
# File 'app/models/concerns/comable/cart_owner.rb', line 36 def count sum(&:quantity) end |
#errors ⇒ Object
TODO: Refactoring
43 44 45 46 47 48 49 |
# File 'app/models/concerns/comable/cart_owner.rb', line 43 def errors ActiveModel::Errors.new(self).tap do |obj| map(&:errors).map(&:full_messages).flatten.each do || obj[:base] << end end end |
#price ⇒ Object
32 33 34 |
# File 'app/models/concerns/comable/cart_owner.rb', line 32 def price sum(&:current_subtotal_price) end |