rakuten_web_service 0.4.1 → 0.4.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2808bdd0c7c2e4fb98c847ffbd725eb87a649ad3
4
- data.tar.gz: c6ab0cea67ec4129fe8af347befa087584c05b73
3
+ metadata.gz: 4ef501ec6ecadcd8616fe2f6e09fcbdb80cb1842
4
+ data.tar.gz: 35694c209c7ea071414ceb3129b9782b7a70592e
5
5
  SHA512:
6
- metadata.gz: 380c0b8a18bd3d16330ac17439f33adfbdacbdd41ad4489270d804f939f0a4eafe8fe929932813aa3afb780b46a290e215f7b100a355b8b752f7a4518082aef4
7
- data.tar.gz: 170c9302895b606d109f3f8630b29a6acd8e579d9d6f8040fd7aebf1d7220caffd38e6cae94d55472808d08bd2ac06d447a2edaf36c2cd4cfd0cbb2b5e4c9981
6
+ metadata.gz: a0b76a733f810b91c33d74de79bdabb7a3419c660d3fdeb463043cbc2320596f66bc7552e5ef4b4eff7a5828c2f2fdfa01fa2f34b9096bd23e684983f1f75c7e
7
+ data.tar.gz: a5a7f9064b434355785972b9ab89e1ac8a9cc172fec04123f75e37059e3620b269e540ada241e009f49f054ef2166eac6e0e8568db7f57be5c82df2818106e9b
@@ -1,5 +1,6 @@
1
1
  require 'rakuten_web_service/resource'
2
2
  require 'rakuten_web_service/ichiba/ranking'
3
+ require 'rakuten_web_service/ichiba/product'
3
4
 
4
5
  module RakutenWebService
5
6
  module Ichiba
@@ -61,6 +62,11 @@ module RakutenWebService
61
62
  RakutenWebService::Ichiba::RankingItem.search(:genre_id => self.id)
62
63
  end
63
64
 
65
+ def products(options={})
66
+ options = options.merge(:genre_id => self.id)
67
+ RakutenWebService::Ichiba::Product.search(options)
68
+ end
69
+
64
70
  def children
65
71
  @params['children'] ||= Genre.search(:genre_id => self.id).first.children
66
72
  end
@@ -1,3 +1,3 @@
1
1
  module RakutenWebService
2
- VERSION = "0.4.1".freeze
2
+ VERSION = "0.4.2".freeze
3
3
  end
@@ -153,4 +153,18 @@ describe RakutenWebService::Ichiba::Genre do
153
153
  expect { genre.ranking }.to_not raise_error
154
154
  end
155
155
  end
156
+
157
+ describe '#products' do
158
+ let(:genre) { RakutenWebService::Ichiba::Genre.new(genre_id) }
159
+
160
+ before do
161
+ stub_request(:get, endpoint).with(:query => expected_query).
162
+ to_return(:body => fixture('ichiba/genre_search.json'))
163
+ end
164
+
165
+ specify "should call Product search with genre_id option" do
166
+ RakutenWebService::Ichiba::Product.should_receive(:search).with(:genre_id => genre_id)
167
+ expect { genre.products }.to_not raise_error
168
+ end
169
+ end
156
170
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rakuten_web_service
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tatsuya Sato
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-03-20 00:00:00.000000000 Z
11
+ date: 2014-04-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday