ruby-jet 0.2.0 → 0.3.0

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: b34d5f4ebcc67f0e93ca04823c9914f37d22b8e5
4
- data.tar.gz: e1793bf65d33615b5e2eb9ce2fae91951eeea8b5
3
+ metadata.gz: b31752f653be2340a80ee0d5521d2ff4338c185b
4
+ data.tar.gz: 8e3d300a60c75e1506a56837e6de9e730336bb13
5
5
  SHA512:
6
- metadata.gz: bba15da8408fde0fce918b578d11b4c224cb02b025ac6d411eccffcbc02c91b03acfe3e11804f03119f5b38560ee4b2b6243a37318a9138339eed5169699c552
7
- data.tar.gz: da5f98ae9fc711f98d37ad185067344865123d24c1b9c711c6ce3ab29e469c522941a17d8809011243938f41d4219ae54477c0eedd7f3bdb2b89707c1b837d76
6
+ metadata.gz: da858463aead9ec7aa3e89d07406aaa65ccc4aa88c1b1d2fa94322f6c149cf4fff20f8af5077b08131f9195347d9371db673c38eb06d6651b8dcab9e132d7903
7
+ data.tar.gz: ea1eaff8fac0ba8942326df3d128b9f86793b6b72632380072db811e7dae9c83d1f004fbe1bb5dfd93930004ceb0dbe0d87e5e190df0419f30d5c0a0615f32e3
data/README.md CHANGED
@@ -2,5 +2,7 @@
2
2
 
3
3
  [![Build Status](https://travis-ci.org/jasonwells/ruby-jet.svg)](https://travis-ci.org/jasonwells/ruby-jet)
4
4
  [![Dependency Status](https://gemnasium.com/jasonwells/ruby-jet.svg)](https://gemnasium.com/jasonwells/ruby-jet)
5
+ [![Code Climate](https://codeclimate.com/github/jasonwells/ruby-jet/badges/gpa.svg)](https://codeclimate.com/github/jasonwells/ruby-jet)
6
+ [![Test Coverage](https://codeclimate.com/github/jasonwells/ruby-jet/badges/coverage.svg)](https://codeclimate.com/github/jasonwells/ruby-jet/coverage)
5
7
 
6
8
  [Jet API](https://developer.jet.com/) service calls implemented in Ruby.
data/lib/jet/client.rb CHANGED
@@ -37,8 +37,13 @@ class Jet::Client
37
37
  def products
38
38
  Products.new(self)
39
39
  end
40
+
41
+ def taxonomy
42
+ Taxonomy.new(self)
43
+ end
40
44
  end
41
45
 
42
46
  require 'jet/client/orders'
43
47
  require 'jet/client/returns'
44
48
  require 'jet/client/products'
49
+ require 'jet/client/taxonomy'
@@ -0,0 +1,27 @@
1
+ require 'rest-client'
2
+ require 'json'
3
+
4
+ class Jet::Client::Taxonomy
5
+ def initialize(client)
6
+ @client = client
7
+ end
8
+
9
+ def get_links(limit, offset, version = "v1")
10
+ headers = @client.token
11
+ params = { limit: limit, offset: offset }
12
+ response = RestClient.get("#{Jet::Client::API_URL}/taxonomy/links/#{version}", headers.merge({ params: params }))
13
+ JSON.parse(response.body) if response.code == 200
14
+ end
15
+
16
+ def get_node(node_url)
17
+ headers = @client.token
18
+ response = RestClient.get("#{Jet::Client::API_URL}#{node_url}", headers)
19
+ JSON.parse(response.body) if response.code == 200
20
+ end
21
+
22
+ def get_node_attributes(node_url)
23
+ headers = @client.token
24
+ response = RestClient.get("#{Jet::Client::API_URL}#{node_url}/attributes", headers)
25
+ JSON.parse(response.body) if response.code == 200
26
+ end
27
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-jet
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jason Wells
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-10-06 00:00:00.000000000 Z
11
+ date: 2015-10-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rest-client
@@ -53,6 +53,7 @@ files:
53
53
  - lib/jet/client/orders.rb
54
54
  - lib/jet/client/products.rb
55
55
  - lib/jet/client/returns.rb
56
+ - lib/jet/client/taxonomy.rb
56
57
  homepage: https://github.com/jasonwells/ruby-jet
57
58
  licenses:
58
59
  - MIT