cart 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/cart.gemspec +1 -1
  2. data/lib/cart/advanced.rb +3 -1
  3. metadata +1 -1
@@ -4,7 +4,7 @@ require "base64"
4
4
 
5
5
  Gem::Specification.new do |s|
6
6
  s.name = "cart"
7
- s.version = "0.0.3"
7
+ s.version = "0.0.4"
8
8
  s.authors = ["Jakub Šťastný aka Botanicus"]
9
9
  s.homepage = "http://github.com/botanicus/cart"
10
10
  s.summary = "Cart is framework agnostic solution for shopping cart."
@@ -103,6 +103,8 @@ class Cart
103
103
  end
104
104
 
105
105
  def count
106
- @items.length
106
+ @items.inject(0) do |sum, item|
107
+ sum + item.count
108
+ end
107
109
  end
108
110
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cart
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - "Jakub \xC5\xA0\xC5\xA5astn\xC3\xBD aka Botanicus"