anego 0.0.4 → 0.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 026df96b9d2f4e3a714ef8064f111252fd50b7fb
4
- data.tar.gz: 002fcdc07afd8f9075ac0a6298951d95c0c4dc92
3
+ metadata.gz: 48dd37dbb48c8c1fa0e8089e9f578942b978eecc
4
+ data.tar.gz: b7da7bf90b5e083147d74c824a2283e488a6e407
5
5
  SHA512:
6
- metadata.gz: 4cd88a534fa24c622ecdcbd415a5b01500c865a78392638250f257dc96fd29d72de38f7a227437ea816063bb79888ef374f35d4c9d601559eaa5162b694a080d
7
- data.tar.gz: 542ba44c9b0beb370eea0c4d4959a27ee40ca1efc273fa4ab11f264cd66b07c9bb8f79d21c0881af84b26b830407336f5aa1ca3cb6cf80d3f507fdcc0d3268fd
6
+ metadata.gz: 64df0246e0ebb84d431aad2c365758a84e531491afe3ba8558f48736a60eb7afd1a74c3e8b329dae96be0410518fcd6bf71e4b2d6407ca98d240ac818de54b7d
7
+ data.tar.gz: b8ec79427f3e0f020c02714f6fb4bf24c7c07c6aff8958a4353084c72171eb21d614979ced3d7d260106d3ee79d791c7579ae41af13da5950f8f26b166c64329
@@ -18,18 +18,26 @@ module Anego
18
18
  request :get, "/apps/#{market}/app/#{product_id}/ratings"
19
19
  end
20
20
 
21
+ def product_reviews(market, product_id, start_date, end_date, country)
22
+ request :get, "/apps/#{market}/app/#{product_id}/reviews", {
23
+ start_date: start_date,
24
+ end_date: end_date,
25
+ countries: country
26
+ }
27
+ end
28
+
21
29
  private
22
30
 
23
- def request(method, path)
24
- Anego::Response.new(execute(method, path))
31
+ def request(method, path, params = {})
32
+ Anego::Response.new(execute(method, path, params))
25
33
  end
26
34
 
27
- def execute(method, path)
35
+ def execute(method, path, params)
28
36
  begin
29
37
  RestClient::Request.execute(
30
38
  method: method,
31
39
  url: api_endpoint(path),
32
- headers: default_headers,
40
+ headers: headers(params),
33
41
  )
34
42
  rescue RestClient::ExceptionWithResponse => err
35
43
  raise err
@@ -40,6 +48,10 @@ module Anego
40
48
  "#{API_ENDPOINT}#{path}"
41
49
  end
42
50
 
51
+ def headers(params)
52
+ params.empty? ? default_headers : default_headers.merge(params: params)
53
+ end
54
+
43
55
  def default_headers
44
56
  {
45
57
  Accept: "application/json",
@@ -1,3 +1,3 @@
1
1
  module Anego
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: anego
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - fakestarbaby
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-01-20 00:00:00.000000000 Z
11
+ date: 2016-04-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rest-client
@@ -106,7 +106,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
106
106
  version: '0'
107
107
  requirements: []
108
108
  rubyforge_project:
109
- rubygems_version: 2.4.5.1
109
+ rubygems_version: 2.5.1
110
110
  signing_key:
111
111
  specification_version: 4
112
112
  summary: Ruby wrapper for the App Annie API