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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 406ebc5a34e1f6ee461dd933317e025274fda3eb
4
- data.tar.gz: 6c3f16b2f13306170597178e3e1f16274335a4b0
3
+ metadata.gz: df12fde0bbda65359049f68cb45bfc3541158e9b
4
+ data.tar.gz: 966dbbfa94afa1a48ea4b1c622edc9585e4610c0
5
5
  SHA512:
6
- metadata.gz: 638d71987adf791e971c62c0e0ebbf329a22bd61817a22daf9314bb38c35969f4d694d4d12650b2e1e31db7bc72673d006018e2f0852dd7230e2eca6a74d28b2
7
- data.tar.gz: bcdb6ab20a15ab15165ec564901a0a4bd44b701a3db11741ee2434c94e8ab4afc7a6d2e88a0abe35b29bdb56c7cb8d4ac93cda22a9e048fda6779d5ddc280b07
6
+ metadata.gz: 9cbcc44f5c7b3d6b228fb1bb7da0d1ee1c5add190da87ac20c09d28e68cb193ae8a7256477fdfa45804881634e4fae3934adadda5b09d9e74904bb8c97fbcece
7
+ data.tar.gz: 3ab8cda7cb6e945b93e0ba934306e922b0684e827d01781a40ae5bfca3d25334d6356f0145d9c65b6ab3578e2468a40e2d378e7082a197c56f2aa2b955b1dd3f
data/CHANGELOG.md CHANGED
@@ -77,3 +77,7 @@
77
77
  ## v0.3.1
78
78
 
79
79
  * Bugfix on nil values cases
80
+
81
+ ## v0.3.2
82
+
83
+ * Added order notes
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
@@ -1,3 +1,3 @@
1
1
  module Mercadolibre
2
- VERSION = "0.3.1"
2
+ VERSION = "0.3.2"
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.3.1
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-17 00:00:00.000000000 Z
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