api_bucket 1.0.3 → 1.0.4
Sign up to get free protection for your applications and to get access to all the features.
@@ -12,7 +12,7 @@ module ApiBucket::Rakuten
|
|
12
12
|
|
13
13
|
def categories
|
14
14
|
{
|
15
|
-
:ALL
|
15
|
+
:ALL => 'ALL',
|
16
16
|
:'101240' => 'CD・DVD/BD・楽器',
|
17
17
|
|
18
18
|
:'100371' => 'レディースファッション',
|
@@ -58,7 +58,7 @@ module ApiBucket::Rakuten
|
|
58
58
|
# delete no needed keys
|
59
59
|
options.delete(:keywords)
|
60
60
|
options.delete(:search_index)
|
61
|
-
options[:genreId] = '0' if options[:genreId] == '
|
61
|
+
options[:genreId] = '0' if options[:genreId] == 'ALL'
|
62
62
|
|
63
63
|
ApiBucket::Rakuten::Response.new(send_request(options, REQUEST_URL))
|
64
64
|
end
|
@@ -77,4 +77,4 @@ module ApiBucket::Rakuten
|
|
77
77
|
ApiBucket::Rakuten::Response.new(send_request(options, REQUEST_URL))
|
78
78
|
end
|
79
79
|
end
|
80
|
-
end
|
80
|
+
end
|
@@ -21,7 +21,7 @@ module ApiBucket::Rakuten
|
|
21
21
|
}
|
22
22
|
|
23
23
|
keys.each do |key, image_key|
|
24
|
-
if element[image_key]
|
24
|
+
if element.has_key?(image_key) and element[image_key].present?
|
25
25
|
matches = element[image_key].first['imageUrl'].match(/(.+)\?_ex=(\d+)x(\d+)/)
|
26
26
|
image_url_no_params = matches[1]
|
27
27
|
size = matches[2]
|
@@ -9,7 +9,6 @@ module ApiBucket::Rakuten
|
|
9
9
|
|
10
10
|
def items
|
11
11
|
return [] if @doc.nil?
|
12
|
-
|
13
12
|
@items ||= @doc["Items"].map {|item| ApiBucket::Rakuten::Item.new(item['Item']) }
|
14
13
|
end
|
15
14
|
|
@@ -18,14 +17,17 @@ module ApiBucket::Rakuten
|
|
18
17
|
end
|
19
18
|
|
20
19
|
def item_page
|
20
|
+
@item_page = 0 if @doc.nil?
|
21
21
|
@item_page ||= @doc[:page].to_i
|
22
22
|
end
|
23
23
|
|
24
24
|
def total_results
|
25
|
+
@total_results = 0 if @doc.nil?
|
25
26
|
@total_results ||= @doc[:count].to_i
|
26
27
|
end
|
27
28
|
|
28
29
|
def total_pages
|
30
|
+
@total_pages = 0 if @doc.nil?
|
29
31
|
@total_pages ||= @doc[:pageCount].to_i
|
30
32
|
end
|
31
33
|
end
|
data/lib/api_bucket/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: api_bucket
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.4
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-03-
|
12
|
+
date: 2013-03-16 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: nokogiri
|