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 CHANGED
@@ -1,6 +1,10 @@
1
1
  Release Notes
2
2
  =============
3
3
 
4
+ ### 0.7.4
5
+
6
+ * Allow fetching all reports for a date ```find_all_by_date```
7
+
4
8
  ### 0.7.3
5
9
 
6
10
  * Allow campaig and advertisement updates
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Adcloud
2
- VERSION = '0.7.3'
2
+ VERSION = '0.7.4'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: adcloud
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.3
4
+ version: 0.7.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: