kosher 0.1.4 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
data/lib/kosher/item.rb CHANGED
@@ -1,13 +1,14 @@
1
1
  module Kosher
2
- class Item < Struct.new(:asin, :offers, :sales_rank)
2
+ class Item < Struct.new(:asin, :offers, :offers_count, :sales_rank)
3
3
 
4
4
  class << self
5
5
  def build(doc)
6
- asin = doc['ASIN']
7
- sales_rank = doc['SalesRank'].to_i
8
- offers = build_offers(doc['Offers']['Offer'])
6
+ asin = doc['ASIN']
7
+ sales_rank = doc['SalesRank'].to_i
8
+ offers_count = doc['Offers']['TotalOffers'].to_i
9
+ offers = build_offers(doc['Offers']['Offer'])
9
10
 
10
- new(asin, offers, sales_rank)
11
+ new(asin, offers, offers_count, sales_rank)
11
12
  end
12
13
 
13
14
  private
@@ -1,3 +1,3 @@
1
1
  module Kosher
2
- VERSION = '0.1.4'
2
+ VERSION = '0.1.5'
3
3
  end
@@ -24,10 +24,8 @@ module Kosher
24
24
  it "should build an item" do
25
25
  item.should be_a Item
26
26
  item.asin.should eql asin
27
+ item.offers_count.should be > 0
27
28
  item.sales_rank.should be > 0
28
- end
29
-
30
- it "should build the offers of an item" do
31
29
  item.offers.count.should > 0
32
30
  item.offers.first.should be_a Offer
33
31
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: kosher
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.1.4
5
+ version: 0.1.5
6
6
  platform: ruby
7
7
  authors:
8
8
  - Paper Cavalier