app_figures 0.1.1 → 0.1.2

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: e7c6c891cd182f1573dadb5b4d86cfd519f0a39c
4
- data.tar.gz: 3188ffb2baf3429dbbeffedbd91f6a9901bf8eaa
3
+ metadata.gz: 888c8d65f179e891792c1bdfb8da43efe3f192f0
4
+ data.tar.gz: 7c278110c5e3ef0df718ae717038e69ae30f92f9
5
5
  SHA512:
6
- metadata.gz: 69a1b535830362732ea87b40d31da98e911c8a8dd40b60e32ade0cfb28d667e6fa7bb5dfdaa3744b8ae7608e18318e83958a96d5916f890ca497c2337ad75b7d
7
- data.tar.gz: be9fcde18a2744922f1743f3b155222cd7e904b2d577bfc921a4590c39f93701a4f2ca3922c0e002cfee52270331f6b831e7ba05461d8d4ad53df45c6bfc6ae3
6
+ metadata.gz: 140444bed45256a380b3baf6b3bb614e35b98e1cac30c91a73c90b0f31cfcc2e1aa785cb6a59b908e8f29a62cbcbc9ab8ed33376bcb6a53f81194454a338dde9
7
+ data.tar.gz: 33c87ef9789f976bd12174ed9b4a181b362c3ca651b2aa5a3258f0cc7163c43b06f55676a47398e5874ffefb78ed7c479717ea5c1d89360dee53c9dade04da07
data/README.md CHANGED
@@ -29,7 +29,7 @@ Or install it globally:
29
29
  This gem currently only supports Basic Auth, but still requires you to register your app to get a client key.
30
30
 
31
31
  1. While logged into AppFigures, visit: https://appfigures.com/developers/keys
32
- 2. Click 'Create a New Client', give it a name, and set your permissions. This gem needs at least `READ` access to "Product Meta Data" and "Private Data".
32
+ 2. Click 'Create a New Client', give it a name, and set your permissions. This gem needs at least `READ` access to "Product Meta Data", "Private Data", and "Account".
33
33
  3. Click 'Make me an app' to complete the registration and get yoru client key.
34
34
 
35
35
  ### Configuration
@@ -148,6 +148,31 @@ sales = client.sales
148
148
  "gift_redemptions"=>0}
149
149
  ```
150
150
 
151
+ #### External Accounts
152
+ Example:
153
+ ```ruby
154
+ client = AppFigures.client
155
+ client.external_accounts
156
+ => {"7648"=>
157
+ {"id"=>76348,
158
+ "account_id"=>89138,
159
+ "nickname"=>"my nickname",
160
+ "username"=>"example@email.com",
161
+ "auto_import"=>true,
162
+ "store_id"=>2,
163
+ "store"=>"google_play",
164
+ "metadata"=>{}},
165
+ "79034"=>
166
+ {"id"=>77392,
167
+ "account_id"=>89138,
168
+ "nickname"=>"my nickname",
169
+ "username"=>"example@email.com",
170
+ "auto_import"=>true,
171
+ "store_id"=>1,
172
+ "store"=>"apple",
173
+ "metadata"=>{"vendor_id"=>78920uy3}}}
174
+ ```
175
+
151
176
  ## Contributing
152
177
 
153
178
  1. Fork it ( https://github.com/styleseek/app_figures/fork )
@@ -32,7 +32,12 @@ module AppFigures
32
32
  query = query.merge({store: store})
33
33
  end
34
34
 
35
- response = self.class.get("/products/mine", query: query, headers: authorization_headers)
35
+ response = self.class.get('/products/mine', query: query, headers: authorization_headers)
36
+ handle_request_status(response)
37
+ end
38
+
39
+ def external_accounts
40
+ response = self.class.get('/external_accounts', headers: authorization_headers)
36
41
  handle_request_status(response)
37
42
  end
38
43
 
@@ -1,3 +1,3 @@
1
1
  module AppFigures
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
@@ -0,0 +1,23 @@
1
+ # encoding: utf-8
2
+
3
+ require 'spec_helper'
4
+
5
+ describe AppFigures::Client do
6
+ context 'products' do
7
+
8
+ before do
9
+ @client = AppFigures::Client.new({client_key: 'exampleclientkey', credentials: 'examplebase64encodedstring'})
10
+ @headers = { 'X-Client-Key' => @client.client_key, 'Authorization' => "Basic #{@client.credentials}" }
11
+ end
12
+
13
+
14
+ it 'makes an api request to external accounts' do
15
+ @client.class.expects(:get)
16
+ .with('/external_accounts', headers: @headers)
17
+ .returns(Response.ok)
18
+
19
+ @client.external_accounts
20
+ end
21
+
22
+ end
23
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: app_figures
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - StyleSeek Engineering
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-06-23 00:00:00.000000000 Z
11
+ date: 2014-07-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty
@@ -60,6 +60,7 @@ files:
60
60
  - lib/app_figures/version.rb
61
61
  - spec/app_figures/app_figures_spec.rb
62
62
  - spec/app_figures/client_spec.rb
63
+ - spec/app_figures/external_accounts_spec.rb
63
64
  - spec/app_figures/products_spec.rb
64
65
  - spec/app_figures/sales_spec.rb
65
66
  - spec/spec_helper.rb
@@ -90,6 +91,7 @@ summary: Simple API Client for AppFigures.com
90
91
  test_files:
91
92
  - spec/app_figures/app_figures_spec.rb
92
93
  - spec/app_figures/client_spec.rb
94
+ - spec/app_figures/external_accounts_spec.rb
93
95
  - spec/app_figures/products_spec.rb
94
96
  - spec/app_figures/sales_spec.rb
95
97
  - spec/spec_helper.rb