mercadolibre 0.3.1 → 0.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/mercadolibre.rb +1 -0
- data/lib/mercadolibre/core/order_management.rb +7 -0
- data/lib/mercadolibre/entity/order_note.rb +25 -0
- data/lib/mercadolibre/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: df12fde0bbda65359049f68cb45bfc3541158e9b
|
4
|
+
data.tar.gz: 966dbbfa94afa1a48ea4b1c622edc9585e4610c0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9cbcc44f5c7b3d6b228fb1bb7da0d1ee1c5add190da87ac20c09d28e68cb193ae8a7256477fdfa45804881634e4fae3934adadda5b09d9e74904bb8c97fbcece
|
7
|
+
data.tar.gz: 3ab8cda7cb6e945b93e0ba934306e922b0684e827d01781a40ae5bfca3d25334d6356f0145d9c65b6ab3578e2468a40e2d378e7082a197c56f2aa2b955b1dd3f
|
data/CHANGELOG.md
CHANGED
data/lib/mercadolibre.rb
CHANGED
@@ -27,6 +27,7 @@ require "mercadolibre/entity/order"
|
|
27
27
|
require "mercadolibre/entity/order_coupon"
|
28
28
|
require "mercadolibre/entity/order_feedback"
|
29
29
|
require "mercadolibre/entity/order_item"
|
30
|
+
require "mercadolibre/entity/order_note"
|
30
31
|
require "mercadolibre/entity/order_shipping"
|
31
32
|
require "mercadolibre/entity/payment"
|
32
33
|
require "mercadolibre/entity/payment_method"
|
@@ -66,6 +66,13 @@ module Mercadolibre
|
|
66
66
|
Mercadolibre::Entity::Order.new(r[:body])
|
67
67
|
end
|
68
68
|
|
69
|
+
def get_order_notes(order_id)
|
70
|
+
filters = { access_token: @access_token }
|
71
|
+
results = get_request("/orders/#{order_id}/notes", filters)
|
72
|
+
|
73
|
+
results[:body].map { |r| Mercadolibre::Entity::OrderNote.new(r) }
|
74
|
+
end
|
75
|
+
|
69
76
|
def get_order_feedbacks(order_id)
|
70
77
|
filters = { access_token: @access_token }
|
71
78
|
|
@@ -0,0 +1,25 @@
|
|
1
|
+
module Mercadolibre
|
2
|
+
module Entity
|
3
|
+
class OrderNote
|
4
|
+
def self.attr_list
|
5
|
+
[:id, :date_created, :date_last_updated, :note]
|
6
|
+
end
|
7
|
+
|
8
|
+
attr_reader *attr_list
|
9
|
+
|
10
|
+
def initialize(attributes={})
|
11
|
+
attributes.each do |k, v|
|
12
|
+
if ['date_created', 'date_last_updated'].include?(k.to_s)
|
13
|
+
self.send("#{k}=", Time.parse(v)) unless v.nil?
|
14
|
+
else
|
15
|
+
self.send("#{k}=", v) if self.respond_to?(k)
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
private
|
21
|
+
|
22
|
+
attr_writer *attr_list
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
data/lib/mercadolibre/version.rb
CHANGED
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.3.
|
4
|
+
version: 0.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matias Hick
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-11-
|
11
|
+
date: 2014-11-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -97,6 +97,7 @@ files:
|
|
97
97
|
- lib/mercadolibre/entity/order_coupon.rb
|
98
98
|
- lib/mercadolibre/entity/order_feedback.rb
|
99
99
|
- lib/mercadolibre/entity/order_item.rb
|
100
|
+
- lib/mercadolibre/entity/order_note.rb
|
100
101
|
- lib/mercadolibre/entity/order_shipping.rb
|
101
102
|
- lib/mercadolibre/entity/payment.rb
|
102
103
|
- lib/mercadolibre/entity/payment_method.rb
|