adcloud 0.7.3 → 0.7.4
Sign up to get free protection for your applications and to get access to all the features.
- data/RELEASE_NOTES.md +4 -0
- data/lib/adcloud/report.rb +21 -0
- data/lib/adcloud/version.rb +1 -1
- metadata +1 -1
data/RELEASE_NOTES.md
CHANGED
data/lib/adcloud/report.rb
CHANGED
@@ -13,6 +13,27 @@ module Adcloud
|
|
13
13
|
return self.new(result)
|
14
14
|
end
|
15
15
|
|
16
|
+
def find_all_by_date(date)
|
17
|
+
paged_items = []
|
18
|
+
page = 0
|
19
|
+
total_pages = 1
|
20
|
+
retry_count = 0
|
21
|
+
page_result = nil
|
22
|
+
begin
|
23
|
+
begin
|
24
|
+
page += 1
|
25
|
+
raw_result = connection.get(self.api_endpoint, { filter: { date: date.to_s }, :page => page, :per_page => Entity::MAX_PER_PAGE })
|
26
|
+
total_pages = raw_result['_meta']['total_pages']
|
27
|
+
page_result = self.new(raw_result)
|
28
|
+
paged_items += page_result.items
|
29
|
+
rescue => ex
|
30
|
+
retry if retry_count < 5
|
31
|
+
end
|
32
|
+
end while page < total_pages
|
33
|
+
page_result.items = paged_items
|
34
|
+
page_result
|
35
|
+
end
|
36
|
+
|
16
37
|
def api_endpoint
|
17
38
|
@api_endpoint ||= self.name.demodulize.tableize
|
18
39
|
end
|
data/lib/adcloud/version.rb
CHANGED