yandex_market_api_client 0.1.1 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4bbf31766fb60cfc4b6e44a10fb527cf10d65332
4
- data.tar.gz: f917e3211e63dd448595c1d45b619fbbd1255b6c
3
+ metadata.gz: b674e487c31b77e9432d1833d552b180bb88c3d4
4
+ data.tar.gz: 6705838060ce9eee084dbe9acec313cd07373860
5
5
  SHA512:
6
- metadata.gz: 73f86e7f9a70476243a8915720c069f9b20511b776e15d492cbe79c2b72fc73395f618b95a88dbad4cb6bd358e9fc27d10894185870c076a9f7eb53ba9c3bc1d
7
- data.tar.gz: 1ce062404d597d7bb8ba78c542eedf421b6ee83a84c149db5a733a83cf7abac76cc50e904f666148bf83a7a1ea5f5ab1c3ef59d7572ecee3acced532f3e24ff3
6
+ metadata.gz: 648961da6590d8d3839f67c63e2cb6571f3df376eadd9eae4b8c9b15a7dc8ae9710bdb3e05e6522a57a83551b0671849f5da05f794cff3accb69480b8dcbbaf1
7
+ data.tar.gz: ed664434bfb7e3e4e353369a84c07155ea882b6e6731819e8f610ccc267e5837b097e8fb418bf2dd4ff9c0c9f98c24d917b8ecca63d6329ad2a4ed7965411be2
data/README.md CHANGED
@@ -12,7 +12,7 @@ the beginnig.
12
12
 
13
13
  Add this line to your application's Gemfile:
14
14
 
15
- gem 'yandex_market_api_wrapper'
15
+ gem 'yandex_market_api_client'
16
16
 
17
17
  And then execute:
18
18
 
@@ -20,13 +20,13 @@ And then execute:
20
20
 
21
21
  Or install it yourself as:
22
22
 
23
- $ gem install yandex_market_api_wrapper
23
+ $ gem install yandex_market_api_client
24
24
 
25
25
  ## Usage
26
26
 
27
27
  ### Basic Information
28
28
 
29
- The structure of the api response will not be provided here in case of large data in it.
29
+ The structure of the api response will not be provided here in case of large data in it.
30
30
  You can look for it in Yandex docs [here](http://api.yandex.ru/market/content/doc/dg/concepts/about.xml).
31
31
 
32
32
  ### Configuration
@@ -120,6 +120,17 @@ client.region(geo_id: 225).perform.parse
120
120
  client.region_children(geo_id: 225).perform.parse
121
121
  ```
122
122
 
123
+ ### Shop Resource
124
+
125
+ The api description is provided [here](https://tech.yandex.ru/market/content/doc/dg/reference/shops-docpage/).
126
+ List of options and required params is provided in the docs on the link upper.
127
+
128
+ + To get shop info:
129
+
130
+ ```ruby
131
+ client.shop_info(shop_id: 24049).perform.parse
132
+ ```
133
+
123
134
  ## Contributing
124
135
 
125
136
  1. Fork it
@@ -80,5 +80,14 @@ module YandexMarketApiClient
80
80
  resource.required :shop_id
81
81
  end
82
82
 
83
+ get :shop_reviews, "/v#{config.api_version}/shop/{shop_id}/opinion.#{format}" do |resource|
84
+ resource.required :shop_id
85
+ resource.optional :sort,
86
+ :how,
87
+ :grade,
88
+ :max_comments, # maximum comments in output
89
+ :page, :count
90
+ end
91
+
83
92
  end
84
93
  end
@@ -1,3 +1,3 @@
1
1
  module YandexMarketApiClient
2
- VERSION = "0.1.1"
2
+ VERSION = "0.2.0"
3
3
  end
@@ -0,0 +1,59 @@
1
+ {
2
+ "shopOpinions": {
3
+ "opinion": [
4
+ {
5
+ "id": 60708018,
6
+ "date": 1452847976000,
7
+ "grade": -1,
8
+ "text": "test comment",
9
+ "agree": 0,
10
+ "reject": 0,
11
+ "visibility": "NAME",
12
+ "author": "test auth",
13
+ "authorInfo": {
14
+ "grades": 4
15
+ },
16
+ "pro": "Гарантийный сервис.",
17
+ "contra": "Не получил товар купленный в интернет магазине.",
18
+ "region": 51,
19
+ "comments": [],
20
+ "shopOrderId": "004-56971985",
21
+ "delivery": "PICKUP",
22
+ "shop": {
23
+ "id": 1,
24
+ "name": "Test shop name"
25
+ },
26
+ "problem": "UNRESOLVED",
27
+ "anonymous": false
28
+ },
29
+
30
+ {
31
+ "id": 60700191,
32
+ "date": 1452799914000,
33
+ "grade": 2,
34
+ "text": "test comment 2",
35
+ "agree": 0,
36
+ "reject": 0,
37
+ "visibility": "NAME",
38
+ "author": "test author 2",
39
+ "authorInfo": {
40
+ "grades": 2
41
+ },
42
+ "pro": "Рядом с домом",
43
+ "contra": "не нашла",
44
+ "region": 213,
45
+ "comments": [],
46
+ "shopOrderId": "002-33354169",
47
+ "delivery": "PICKUP",
48
+ "shop": {
49
+ "id": 1,
50
+ "name": "Test shop name"
51
+ },
52
+ "anonymous": false
53
+ }
54
+ ],
55
+ "total": 13382,
56
+ "page": 1,
57
+ "count": 10
58
+ }
59
+ }
@@ -21,4 +21,11 @@ class ShopResourceTest < TestCase
21
21
 
22
22
  assert_requested stub
23
23
  end
24
+
25
+ def test_getting_shop_reviews
26
+ stub = stub_request(:get, @shop_url % "1" + "/opinion.json").
27
+ to_return(@return.merge(body: load_fixture('shop_reviews.json')))
28
+
29
+ @client.shop_reviews(shop_id: 1).perform.parse
30
+ end
24
31
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yandex_market_api_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Igor Kuznetsov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-12-18 00:00:00.000000000 Z
11
+ date: 2016-01-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: weary
@@ -69,6 +69,7 @@ files:
69
69
  - test/fixtures/model_offers.json
70
70
  - test/fixtures/model_opinions.json
71
71
  - test/fixtures/shop.json
72
+ - test/fixtures/shop_reviews.json
72
73
  - test/helpers/configuration_helper.rb
73
74
  - test/helpers/fixtures_helper.rb
74
75
  - test/lib/yandex_market_api_client/category_resource_test.rb
@@ -97,7 +98,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
97
98
  version: '0'
98
99
  requirements: []
99
100
  rubyforge_project:
100
- rubygems_version: 2.2.2
101
+ rubygems_version: 2.4.5.1
101
102
  signing_key:
102
103
  specification_version: 4
103
104
  summary: It's a wrapper for YandexMarket Api calls written in Ruby. Useful for clients
@@ -116,6 +117,7 @@ test_files:
116
117
  - test/fixtures/model_offers.json
117
118
  - test/fixtures/model_opinions.json
118
119
  - test/fixtures/shop.json
120
+ - test/fixtures/shop_reviews.json
119
121
  - test/helpers/configuration_helper.rb
120
122
  - test/helpers/fixtures_helper.rb
121
123
  - test/lib/yandex_market_api_client/category_resource_test.rb