tiendanube-ruby 0.1.3 → 0.1.4

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: 616ab4f1c9bce0cae66da3fb7512ccde2afcd8a2
4
- data.tar.gz: 4437dd19e8067d9bf47aea5894c9abdeb8ed470b
3
+ metadata.gz: 803b2efafc2fcf5205e0e2b748b8d7f9bf6bbdcf
4
+ data.tar.gz: e53b933ebf1d0acddeb3610732dafc6de662b986
5
5
  SHA512:
6
- metadata.gz: 0699fcb6336483630d8db74fdbfaf761eafbd2001352bac314130a5d7909d9d36e9b1b1cce1d5fb27debc172d85d21a162be6d3c63e05cedba9a32f798a59769
7
- data.tar.gz: 22111e3bb893d44e0e9064dcb9e63b65b96741748687fef7530823068be546e71704a2a79beb2ede6c5cc089ca3a565af54c482efe728dd85ef582352093731e
6
+ metadata.gz: 904a9aa46e916e1e60e9331f777cc46e9af95e9c8dcef4014e31cd95dacba2f819f76ad4dfbffb01cfff8138b2b959649ba09f454b940a862e7d10114c185e5b
7
+ data.tar.gz: adb09d9cc64fd3d0ea25b5525fe3eab8bce1b2a7b0786c0142c70a0a78105faad0e9939a0419ad35524471d575c395193a62b2d91642c125396b89b8360e3982
@@ -20,7 +20,8 @@ module TiendaNube
20
20
  result = {
21
21
  :status => [response.code, response.message],
22
22
  :headers => response.to_hash,
23
- :body => JSON.parse(response.body)
23
+ :body => response.body && !response.body.empty? ?
24
+ JSON.parse(response.body) : nil
24
25
  }
25
26
  if links = response["link"]
26
27
  result[:pages] = links.split(", ").inject({}) do |hash, link|
@@ -99,10 +100,16 @@ module TiendaNube
99
100
  class Category < Resource::Base
100
101
  self.name = 'categories'
101
102
  end
103
+ class Customer < Resource::Base
104
+ self.name = 'customers'
105
+ end
102
106
  class ProductVariant < Resource::Base
103
107
  class << self
104
108
  attr_accessor :product_id
105
- self.name = 'variants'
109
+
110
+ def name
111
+ "products/#{self.product_id}/variants"
112
+ end
106
113
  end
107
114
  def self.url(id = nil)
108
115
  url = "#{Resource.base_url}/products/#{self.product_id}/#{self.name}"
@@ -1,3 +1,3 @@
1
1
  module TiendaNube
2
- VERSION = "0.1.3"
2
+ VERSION = "0.1.4"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tiendanube-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Carlos Kozuszko
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-08-23 00:00:00.000000000 Z
11
+ date: 2016-08-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json