google-book 0.3.1 → 0.3.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/google/book/response.rb +10 -7
- data/lib/google/book/version.rb +1 -1
- metadata +1 -1
data/lib/google/book/response.rb
CHANGED
@@ -10,13 +10,6 @@ module Google
|
|
10
10
|
end
|
11
11
|
|
12
12
|
def each(&block)
|
13
|
-
members =
|
14
|
-
if total_results == 0
|
15
|
-
[]
|
16
|
-
else
|
17
|
-
[@feed['entry']].flatten
|
18
|
-
end
|
19
|
-
|
20
13
|
members.each do |member|
|
21
14
|
block.call(Entry.new(member))
|
22
15
|
end
|
@@ -25,6 +18,16 @@ module Google
|
|
25
18
|
def total_results
|
26
19
|
@feed['openSearch:totalResults'].to_i
|
27
20
|
end
|
21
|
+
|
22
|
+
private
|
23
|
+
|
24
|
+
def members
|
25
|
+
if total_results == 0
|
26
|
+
[]
|
27
|
+
else
|
28
|
+
[@feed['entry']].flatten
|
29
|
+
end
|
30
|
+
end
|
28
31
|
end
|
29
32
|
end
|
30
33
|
end
|
data/lib/google/book/version.rb
CHANGED