mercadolibre 0.6.1 → 0.7.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: f1e9964fe83c574c04b567cd0c279149b027f591
4
- data.tar.gz: c9ca3913cb9f2642bf115c8a7bc8fa1467992577
3
+ metadata.gz: 2a37112d42aab380e876e14d7abb653e25f39e1c
4
+ data.tar.gz: 5e5b962ae73e34a2e80efdbedf92701b23addc2f
5
5
  SHA512:
6
- metadata.gz: 27d8e88fad4c07f14e5adae63a81391a7ed5afc0bc9c6011d8d4942d9bfe40f8cd193ecf0f3134397090af558dcddd3df7c11f74999196c198f62d013a3c2d0b
7
- data.tar.gz: 96d41c4a3fe9b389ccbb3723b60930d0c22bce2f382d58111eb8f2f955520468ba6b85cdea1ff1739a1dfe29597101fbf13ebb333d1026d16a6e65854b54e155
6
+ metadata.gz: 8841adfb471f1976699254dbf74dc7d69d7ac703de5856e7a8d711144e29430c38f55cf6241b8539f35cb54c833b1c3639287a28007350d87b2d10df06a1ec8c
7
+ data.tar.gz: a8a8a58c3feb9883ed1296cf8a1698df4545e56d0e89f5d305a3c3656a31cffadb1184a0e10ec5af115350132bb42c54ec722e9f56d0503fe93e5f9d8a41b5cc
data/CHANGELOG.md CHANGED
@@ -125,3 +125,7 @@
125
125
  ## v0.6.1
126
126
 
127
127
  * Bugfix item shipping
128
+
129
+ ## v0.7.0
130
+
131
+ * Added orders blacklist and renamed methods for questions blacklist
@@ -179,10 +179,25 @@ module Mercadolibre
179
179
  Mercadolibre::Entity::PaymentMethod.new(results[:body])
180
180
  end
181
181
 
182
- def get_order_blacklist(user_id)
182
+ def get_orders_blacklist(user_id)
183
183
  results = get_request("/users/#{user_id}/order_blacklist?access_token=#{@access_token}")
184
+ result[:body].map { |r| r['user']['id'] }
185
+ end
186
+
187
+ def add_user_to_orders_blacklist(seller_id, user_id)
188
+ payload = { user_id: user_id }.to_json
189
+
190
+ headers = { content_type: :json }
191
+
192
+ url = "/users/#{seller_id}/order_blacklist?access_token=#{@access_token}"
193
+
194
+ post_request(url, payload, headers)[:status_code] == 200
195
+ end
196
+
197
+ def remove_user_from_orders_blacklist(seller_id, user_id)
198
+ url = "/users/#{seller_id}/order_blacklist/#{user_id}?access_token=#{@access_token}"
184
199
 
185
- results[:body].map { |r| Mercadolibre::Entity::User.new(r) }
200
+ delete_request(url)[:status_code] == 200
186
201
  end
187
202
  end
188
203
  end
@@ -110,12 +110,12 @@ module Mercadolibre
110
110
  Mercadolibre::Entity::Question.new(result[:body])
111
111
  end
112
112
 
113
- def get_blacklisted_users_ids(seller_id)
113
+ def get_questions_blacklist(seller_id)
114
114
  result = get_request("/users/#{seller_id}/questions_blacklist?access_token=#{@access_token}")
115
115
  result[:body].map { |r| r['user']['id'] }
116
116
  end
117
117
 
118
- def add_user_to_blacklist(seller_id, user_id)
118
+ def add_user_to_questions_blacklist(seller_id, user_id)
119
119
  payload = { user_id: user_id }.to_json
120
120
 
121
121
  headers = { content_type: :json }
@@ -125,7 +125,7 @@ module Mercadolibre
125
125
  post_request(url, payload, headers)[:status_code] == 200
126
126
  end
127
127
 
128
- def remove_user_from_blacklist(seller_id, user_id)
128
+ def remove_user_from_questions_blacklist(seller_id, user_id)
129
129
  url = "/users/#{seller_id}/questions_blacklist/#{user_id}?access_token=#{@access_token}"
130
130
 
131
131
  delete_request(url)[:status_code] == 200
@@ -1,3 +1,3 @@
1
1
  module Mercadolibre
2
- VERSION = "0.6.1"
2
+ VERSION = "0.7.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mercadolibre
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.1
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matias Hick
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-05-27 00:00:00.000000000 Z
11
+ date: 2015-07-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler