ruby-jet 0.8.0 → 0.9.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: ab0c6941af59144ef32aede49b14ac55f59b31b9
4
- data.tar.gz: 271a0086878c55d64c6232505e074ab30b779c87
3
+ metadata.gz: 4db850f74e0007fcc41c09b46400d3f26d207523
4
+ data.tar.gz: 2a956bf74af51e4d5ccc75e28cc0888b0381577c
5
5
  SHA512:
6
- metadata.gz: 84b566caba7a6e70fce7adb14da6b287fdf88299cb222c8515e65c397d5fd06fa59cb77ba7ff6ed4ea465191a9b32b083b2b99829f224810d7b7c625a4c8dab6
7
- data.tar.gz: 84213789ddda46fa88482ffdb13e1870fc7d4dedd489c3cd6a37767aa88e88e5253e20dfcf6c3dd495c7194cd58279cc22901c11cae3edc42aab75128d85caca
6
+ metadata.gz: 6b163f3737566ed9da2c04bc4df4ca8cb7a4a28af77f015cc97fe83c80e9aa09f111e0bfc396649a332d4cf2f733fd006c281ff8f7af70cb217c237b89a4d463
7
+ data.tar.gz: 7bfae3a5ebe4e3c086da02f187bfa587776777cdd7d62d7746c8d876e748e5994f84ae99dff387c25802a74ddb646e3bbade83d134a539e4eb2dcf7e783ac8e4
data/README.md CHANGED
@@ -3,8 +3,144 @@
3
3
  [![Build Status](https://travis-ci.org/jasonwells/ruby-jet.svg)](https://travis-ci.org/jasonwells/ruby-jet)
4
4
  [![CircleCI](https://circleci.com/gh/jasonwells/ruby-jet.svg?style=shield)](https://circleci.com/gh/jasonwells/ruby-jet)
5
5
  [![Dependency Status](https://gemnasium.com/jasonwells/ruby-jet.svg)](https://gemnasium.com/jasonwells/ruby-jet)
6
- [![Code Climate](https://codeclimate.com/github/jasonwells/ruby-jet/badges/gpa.svg)](https://codeclimate.com/github/jasonwells/ruby-jet)
7
- [![Test Coverage](https://codeclimate.com/github/jasonwells/ruby-jet/badges/coverage.svg)](https://codeclimate.com/github/jasonwells/ruby-jet/coverage)
8
6
  [![Gem Version](https://badge.fury.io/rb/ruby-jet.svg)](https://badge.fury.io/rb/ruby-jet)
9
7
 
10
8
  [Jet API](https://developer.jet.com/) service calls implemented in Ruby.
9
+
10
+ ## Basic Usage
11
+
12
+ require 'Jet'
13
+
14
+ jet_client = Jet.client(merchant_id: 'your_merch_id', api_user: 'your_api_user', secret: 'your_secret')
15
+
16
+ ## Products
17
+ [Jet Products API](https://developer.jet.com/docs/merchant-sku)
18
+
19
+ Product Attributes
20
+
21
+ ```ruby
22
+ attrs = {
23
+ product_title: 'My Product',
24
+ ASIN: '12345ABCDE',
25
+ brand: "My Product's Brand",
26
+ manufacturer: "My Product's Manufacturer",
27
+ main_image_url: 'https://c2.q-assets.com/images/products/p/asj/asj-077_1z.jpg',
28
+ bullets: [ 'This is bullet line 1',
29
+ 'This is bullet line 2',
30
+ ],
31
+ product_description: 'This is a terrific product that everyone should own.',
32
+ multipack_quantity: 1
33
+ }
34
+ ```
35
+
36
+ Call products.update_product to add a new product or update an existing one.
37
+ If the SKU is new, a new product will be created.
38
+
39
+ ```ruby
40
+ response = jet_client.products.update_product('MyNewSku123', attrs)
41
+ ```
42
+
43
+ Retrieve an existing product
44
+
45
+ ```ruby
46
+ product = jet_client.products.get_product('MyNewSku123')
47
+ ```
48
+
49
+ Set the price on a product
50
+
51
+ ```ruby
52
+ response = jet_client.products.update_price('MyNewSku123', price: 30.95)
53
+ ```
54
+
55
+ Update the inventory
56
+
57
+ ```ruby
58
+ response = jet_client.products.update_inventory(
59
+ 'MyNewSku123',
60
+ fulfillment_nodes: [
61
+ { fulfillment_node_id: 'node1234', quantity: 100 },
62
+ { fulfillment_node_id: 'node5678', quantity: 20 }
63
+ ]
64
+ )
65
+ ```
66
+
67
+ ## Retrieve Orders
68
+ [Jet Orders API](https://developer.jet.com/docs/order-status)
69
+
70
+ get_orders defaults to 'ready' status
71
+
72
+ ```ruby
73
+ response = jet_client.orders.get_orders
74
+ ready_orders = response['order_urls']
75
+ ```
76
+
77
+ Retrieve acknowledged orders
78
+
79
+ ```ruby
80
+ response = jet_client.orders.get_orders(:acknowledged)
81
+ acknowledged_orders = response['order_urls']
82
+ ```
83
+
84
+ Other status options are:
85
+
86
+ ```ruby
87
+ :created
88
+ :ready
89
+ :acknowledged
90
+ :inprogress
91
+ :complete
92
+ ```
93
+
94
+ Retrieve a specific order
95
+
96
+ ```ruby
97
+ order_url = ready_orders.first
98
+ order = jet_client.orders.get_order(order_url)
99
+ ```
100
+
101
+ ## Acknowledge an Order
102
+ [Jet Acknowledge Order API](https://developer.jet.com/docs/acknowledge-order)
103
+
104
+ ```ruby
105
+ jet_order_id = order['merchant_order_id']
106
+ response = jet_client.orders.acknowledge_order(
107
+ jet_order_id,
108
+ acknowledgement_status: 'accepted',
109
+ alt_order_id: '232145', # optional
110
+ order_items: [
111
+ { order_item_acknowledgement_status: 'fulfillable',
112
+ order_item_id: 'b81f073b18f548b892f6d4497af16297',
113
+ alt_order_item_id: '554443322' # optional
114
+ }
115
+ ]
116
+ )
117
+ ```
118
+
119
+ Mark Order as shipped
120
+ [Jet Ship Order API](https://developer.jet.com/docs/ship-order)
121
+
122
+ ```ruby
123
+ response = jet_client.orders.ship_order(
124
+ jet_order_id,
125
+ alt_order_id: '232145', # optional
126
+ shipments: [
127
+ {
128
+ alt_shipment_id: '11223344', #optional
129
+ shipment_tracking_number: '1Z12342452342',
130
+ response_shipment_date: 0.days.from_now,
131
+ response_shipment_method: 'ups_ground',
132
+ expected_delivery_date: 4.days.from_now,
133
+ ship_from_zip_code: '12061',
134
+ carrier_pick_up_date: 1.days.from_now,
135
+ carrier: 'UPS',
136
+ shipment_items: [
137
+ { shipment_item_id: '76-s2507-i1810',
138
+ alt_shipment_item_id: '129900120', # optional
139
+ merchant_sku: 'MyNewSku123',
140
+ response_shipment_sku_quantity: 1
141
+ }
142
+ ]
143
+ }
144
+ ]
145
+ )
146
+ ```
data/lib/jet.rb CHANGED
@@ -1,4 +1,5 @@
1
- class Jet
1
+ # Jet API module
2
+ module Jet
2
3
  def self.client(credentials = {})
3
4
  Client.new(credentials)
4
5
  end
data/lib/jet/client.rb CHANGED
@@ -1,80 +1,80 @@
1
1
  require 'rest-client'
2
2
  require 'oj'
3
3
 
4
- class Jet::Client
5
- API_URL = 'https://merchant-api.jet.com/api'
6
-
7
- def initialize(config = {})
8
- @api_user = config[:api_user]
9
- @secret = config[:secret]
10
- @merchant_id = config[:merchant_id]
11
- end
12
-
13
- def encode_json(data)
14
- Oj.dump(data, mode: :compat)
15
- end
4
+ module Jet
5
+ # Jet API Client
6
+ class Client
7
+ API_URL = 'https://merchant-api.jet.com/api'.freeze
8
+
9
+ def initialize(config = {})
10
+ @api_user = config[:api_user]
11
+ @secret = config[:secret]
12
+ @merchant_id = config[:merchant_id]
13
+ end
16
14
 
17
- def decode_json(json)
18
- Oj.load(json)
19
- end
15
+ def encode_json(data)
16
+ Oj.dump(data, mode: :compat)
17
+ end
20
18
 
21
- def token
22
- if not (@id_token and @token_type and @expires_on > Time.now)
23
- body = {
24
- user: @api_user,
25
- pass: @secret
26
- }
27
- response = RestClient.post("#{API_URL}/token", encode_json(body))
28
- parsed_response = decode_json(response.body)
29
- @id_token = parsed_response['id_token']
30
- @token_type = parsed_response['token_type']
31
- @expires_on = Time.parse(parsed_response['expires_on'])
19
+ def decode_json(json)
20
+ Oj.load(json)
32
21
  end
33
22
 
34
- { Authorization: "#{@token_type} #{@id_token}" }
35
- end
23
+ def token
24
+ unless @id_token && @token_type && @expires_on > Time.now
25
+ body = { user: @api_user, pass: @secret }
26
+ response = RestClient.post("#{API_URL}/token", encode_json(body))
27
+ parsed_response = decode_json(response.body)
28
+ @id_token = parsed_response['id_token']
29
+ @token_type = parsed_response['token_type']
30
+ @expires_on = Time.parse(parsed_response['expires_on'])
31
+ end
32
+
33
+ { Authorization: "#{@token_type} #{@id_token}" }
34
+ end
36
35
 
37
- def rest_get_with_token(path, query_params = {})
38
- headers = token
39
- headers.merge!({ params: query_params }) unless query_params.empty?
40
- response = RestClient.get("#{API_URL}#{path}", headers)
41
- decode_json(response.body) if response.code == 200
42
- end
36
+ def rest_get_with_token(path, query_params = {})
37
+ headers = token
38
+ headers[:params] = query_params unless query_params.empty?
39
+ response = RestClient.get("#{API_URL}#{path}", headers)
40
+ decode_json(response.body) if response.code == 200
41
+ end
43
42
 
44
- def rest_put_with_token(path, body = {})
45
- headers = token
46
- response = RestClient.put("#{API_URL}#{path}", body.to_json, headers)
47
- decode_json(response.body) if response.code == 200
48
- end
43
+ def rest_put_with_token(path, body = {})
44
+ headers = token
45
+ response = RestClient.put("#{API_URL}#{path}", encode_json(body), headers)
46
+ decode_json(response.body) if response.code == 200
47
+ end
49
48
 
50
- def rest_post_with_token(path, body = {})
51
- headers = token
52
- response = RestClient.post("#{API_URL}#{path}", body.to_json, headers)
53
- decode_json(response.body) if response.code == 201
54
- end
49
+ def rest_post_with_token(path, body = {})
50
+ headers = token
51
+ response = RestClient.post("#{API_URL}#{path}", encode_json(body), headers)
52
+ decode_json(response.body) if response.code == 201
53
+ end
55
54
 
56
- def orders
57
- Orders.new(self)
58
- end
55
+ def orders
56
+ Orders.new(self)
57
+ end
59
58
 
60
- def returns
61
- Returns.new(self)
62
- end
59
+ def returns
60
+ Returns.new(self)
61
+ end
63
62
 
64
- def products
65
- Products.new(self)
66
- end
63
+ def products
64
+ Products.new(self)
65
+ end
67
66
 
68
- def taxonomy
69
- Taxonomy.new(self)
70
- end
67
+ def taxonomy
68
+ Taxonomy.new(self)
69
+ end
71
70
 
72
- def files
73
- Files.new(self)
74
- end
71
+ def files
72
+ Files.new(self)
73
+ end
75
74
 
76
- def refunds
77
- Refunds.new(self)
75
+ def refunds
76
+ Refunds.new(self)
77
+ end
78
78
  end
79
79
  end
80
80
 
@@ -84,3 +84,4 @@ require 'jet/client/products'
84
84
  require 'jet/client/taxonomy'
85
85
  require 'jet/client/files'
86
86
  require 'jet/client/refunds'
87
+ require 'jet/client/returns'
@@ -1,36 +1,39 @@
1
- require 'rest-client'
2
- require 'oj'
3
1
  require 'zlib'
4
2
  require 'stringio'
5
3
 
6
- class Jet::Client::Files
7
- def initialize(client)
8
- @client = client
9
- end
4
+ module Jet
5
+ class Client
6
+ # Files client
7
+ class Files
8
+ def initialize(client)
9
+ @client = client
10
+ end
10
11
 
11
- def upload_token
12
- @client.rest_get_with_token('/files/uploadToken')
13
- end
12
+ def upload_token
13
+ @client.rest_get_with_token('/files/uploadToken')
14
+ end
14
15
 
15
- def file_upload(url, body)
16
- headers = { 'x-ms-blob-type' => 'blockblob' }
17
- io = StringIO.new
18
- gz = Zlib::GzipWriter.new(io)
19
- gz.write(body)
20
- gz.close
21
- gzipped_body = io.string
22
- response = RestClient.put(url, gzipped_body, headers)
23
- @client.decode_json(response.body) if response.code == 200
24
- end
16
+ def file_upload(url, body)
17
+ headers = { 'x-ms-blob-type' => 'blockblob' }
18
+ io = StringIO.new
19
+ gz = Zlib::GzipWriter.new(io)
20
+ gz.write(body)
21
+ gz.close
22
+ gzipped_body = io.string
23
+ response = RestClient.put(url, gzipped_body, headers)
24
+ @client.decode_json(response.body) if response.code == 200
25
+ end
25
26
 
26
- def uploaded_files(url, file_type, file_name)
27
- headers = @client.token
28
- body = { url: url, file_type: file_type, file_name: file_name }
29
- response = RestClient.post("#{Jet::Client::API_URL}/files/uploaded", @client.encode_json(body), headers)
30
- @client.decode_json(response.body) if response.code == 200
31
- end
27
+ def uploaded_files(url, file_type, file_name)
28
+ headers = @client.token
29
+ body = { url: url, file_type: file_type, file_name: file_name }
30
+ response = RestClient.post("#{Jet::Client::API_URL}/files/uploaded", @client.encode_json(body), headers)
31
+ @client.decode_json(response.body) if response.code == 200
32
+ end
32
33
 
33
- def jet_file_id(file_id)
34
- @client.rest_get_with_token("/files/#{file_id}")
34
+ def jet_file_id(file_id)
35
+ @client.rest_get_with_token("/files/#{file_id}")
36
+ end
37
+ end
35
38
  end
36
39
  end
@@ -1,41 +1,50 @@
1
- require 'rest-client'
2
-
3
- class Jet::Client::Orders
4
-
5
- STATUSES = {
6
- created: 'created',
7
- ready: 'ready',
8
- acknowledged: 'acknowledged',
9
- inprogress: 'inprogress',
10
- complete: 'complete',
11
- }
12
-
13
- def initialize(client)
14
- @client = client
15
- end
16
-
17
- def get_orders(status = :ready)
18
- query_status = STATUSES[status]
19
- @client.rest_get_with_token("/orders/#{query_status}")
20
- end
21
-
22
- def get_order(order_url)
23
- @client.rest_get_with_token(order_url)
24
- end
25
-
26
- def get_order_by_id(order_id)
27
- @client.rest_get_with_token("/orders/withoutShipmentDetail/#{order_id}")
28
- end
29
-
30
- def acknowledge_order(order_id, body = {})
31
- @client.rest_put_with_token("/orders/#{order_id}/acknowledge", body)
32
- end
33
-
34
- def ship_order(order_id, body = {})
35
- @client.rest_put_with_token("/orders/#{order_id}/shipped", body)
36
- end
37
-
38
- def get_directed_cancel
39
- @client.rest_get_with_token('/orders/directedCancel')
1
+ module Jet
2
+ class Client
3
+ # Orders client
4
+ class Orders
5
+ STATUSES = {
6
+ created: 'created',
7
+ ready: 'ready',
8
+ acknowledged: 'acknowledged',
9
+ inprogress: 'inprogress',
10
+ complete: 'complete'
11
+ }
12
+
13
+ def initialize(client)
14
+ @client = client
15
+ end
16
+
17
+ def get_orders(status = :ready, params = {})
18
+ query_status = STATUSES[status]
19
+ @client.rest_get_with_token("/orders/#{query_status}", params)
20
+ end
21
+
22
+ def get_order(order_url)
23
+ @client.rest_get_with_token(order_url)
24
+ end
25
+
26
+ def get_order_by_id(order_id)
27
+ @client.rest_get_with_token("/orders/withoutShipmentDetail/#{order_id}")
28
+ end
29
+
30
+ def acknowledge_order(order_id, body = {})
31
+ @client.rest_put_with_token("/orders/#{order_id}/acknowledge", body)
32
+ end
33
+
34
+ def ship_order(order_id, body = {})
35
+ @client.rest_put_with_token("/orders/#{order_id}/shipped", body)
36
+ end
37
+
38
+ def tag_order(order_id, tag)
39
+ body = { tag: tag } if tag
40
+ @client.rest_put_with_token("/orders/#{order_id}/tag", body)
41
+ end
42
+
43
+ def check_for_tagged_orders(status, tag, with_tag = true)
44
+ query_status = STATUSES[status]
45
+ query_with_tag = with_tag ? true : false
46
+ @client.rest_get_with_token("/orders/#{query_status}/#{tag}/#{query_with_tag}")
47
+ end
48
+ end
40
49
  end
41
50
  end
@@ -1,39 +1,42 @@
1
- require 'rest-client'
2
-
3
- class Jet::Client::Products
4
- def initialize(client)
5
- @client = client
6
- end
7
-
8
- def update_inventory(merchant_sku, body = {})
9
- @client.rest_put_with_token("/merchant-skus/#{merchant_sku}/inventory", body)
10
- end
11
-
12
- def get_inventory(merchant_sku)
13
- @client.rest_get_with_token("/merchant-skus/#{merchant_sku}/inventory")
14
- end
15
-
16
- def update_product(merchant_sku, body = {})
17
- @client.rest_put_with_token("/merchant-skus/#{merchant_sku}", body)
18
- end
19
-
20
- def get_product(merchant_sku)
21
- @client.rest_get_with_token("/merchant-skus/#{merchant_sku}")
22
- end
23
-
24
- def update_price(merchant_sku, body = {})
25
- @client.rest_put_with_token("/merchant-skus/#{merchant_sku}/price", body)
26
- end
27
-
28
- def get_price(merchant_sku)
29
- @client.rest_get_with_token("/merchant-skus/#{merchant_sku}/price")
30
- end
31
-
32
- def update_image(merchant_sku, body = {})
33
- @client.rest_put_with_token("/merchant-skus/#{merchant_sku}/image", body)
34
- end
35
-
36
- def get_products(params = {})
37
- @client.rest_get_with_token('/merchant-skus', params)
1
+ module Jet
2
+ class Client
3
+ # Products client
4
+ class Products
5
+ def initialize(client)
6
+ @client = client
7
+ end
8
+
9
+ def update_inventory(merchant_sku, body = {})
10
+ @client.rest_put_with_token("/merchant-skus/#{merchant_sku}/inventory", body)
11
+ end
12
+
13
+ def get_inventory(merchant_sku)
14
+ @client.rest_get_with_token("/merchant-skus/#{merchant_sku}/inventory")
15
+ end
16
+
17
+ def update_product(merchant_sku, body = {})
18
+ @client.rest_put_with_token("/merchant-skus/#{merchant_sku}", body)
19
+ end
20
+
21
+ def get_product(merchant_sku)
22
+ @client.rest_get_with_token("/merchant-skus/#{merchant_sku}")
23
+ end
24
+
25
+ def update_price(merchant_sku, body = {})
26
+ @client.rest_put_with_token("/merchant-skus/#{merchant_sku}/price", body)
27
+ end
28
+
29
+ def get_price(merchant_sku)
30
+ @client.rest_get_with_token("/merchant-skus/#{merchant_sku}/price")
31
+ end
32
+
33
+ def update_image(merchant_sku, body = {})
34
+ @client.rest_put_with_token("/merchant-skus/#{merchant_sku}/image", body)
35
+ end
36
+
37
+ def get_products(params = {})
38
+ @client.rest_get_with_token('/merchant-skus', params)
39
+ end
40
+ end
38
41
  end
39
42
  end
@@ -1,28 +1,30 @@
1
- require 'rest-client'
1
+ module Jet
2
+ class Client
3
+ # Refunds client
4
+ class Refunds
5
+ STATUSES = {
6
+ created: 'created',
7
+ processing: 'processing',
8
+ accepted: 'accepted',
9
+ rejected: 'rejected'
10
+ }.freeze
2
11
 
3
- class Jet::Client::Refunds
12
+ def initialize(client)
13
+ @client = client
14
+ end
4
15
 
5
- STATUSES = {
6
- created: 'created',
7
- processing: 'processing',
8
- accepted: 'accepted',
9
- rejected: 'rejected',
10
- }
16
+ def create_merchant_initiated_refund(order_id, alt_refund_id, body = {})
17
+ @client.rest_post_with_token("/refunds/#{order_id}/#{alt_refund_id}", body)
18
+ end
11
19
 
12
- def initialize(client)
13
- @client = client
14
- end
15
-
16
- def create_merchant_initiated_refund(order_id, alt_refund_id, body = {})
17
- @client.rest_post_with_token("/refunds/#{order_id}/#{alt_refund_id}", body)
18
- end
19
-
20
- def check_refund_state(refund_authorization_id)
21
- @client.rest_get_with_token("/refunds/state/#{refund_authorization_id}")
22
- end
20
+ def check_refund_state(refund_authorization_id)
21
+ @client.rest_get_with_token("/refunds/state/#{refund_authorization_id}")
22
+ end
23
23
 
24
- def check_for_created_refunds(status)
25
- query_status = STATUSES[status]
26
- @client.rest_get_with_token("/refunds/#{query_status}")
24
+ def check_for_created_refunds(status)
25
+ query_status = STATUSES[status]
26
+ @client.rest_get_with_token("/refunds/#{query_status}")
27
+ end
28
+ end
27
29
  end
28
30
  end
@@ -1,32 +1,33 @@
1
- require 'rest-client'
1
+ module Jet
2
+ class Client
3
+ # Returns client
4
+ class Returns
5
+ STATUSES = {
6
+ created: 'created',
7
+ inprogress: 'inprogress',
8
+ completed_by_merchant: 'completed%20by%20merchant'
9
+ }.freeze
2
10
 
3
- class Jet::Client::Returns
11
+ def initialize(client)
12
+ @client = client
13
+ end
4
14
 
5
- STATUSES = {
6
- created: 'created',
7
- acknowledged: 'acknowledged',
8
- refund_customer_without_return: 'refund%20customer%20without%20return',
9
- completed_by_merchant: 'completed%20by%20merchant',
10
- }
15
+ def get_returns(status = :created)
16
+ query_status = STATUSES[status]
17
+ @client.rest_get_with_token("/returns/#{query_status}")
18
+ end
11
19
 
12
- def initialize(client)
13
- @client = client
14
- end
15
-
16
- def get_returns(status = :created)
17
- query_status = STATUSES[status]
18
- @client.rest_get_with_token("/returns/#{query_status}")
19
- end
20
+ def get_return(return_url)
21
+ @client.rest_get_with_token(return_url)
22
+ end
20
23
 
21
- def get_return(return_url)
22
- @client.rest_get_with_token(return_url)
23
- end
24
-
25
- def get_return_by_id(return_id)
26
- @client.rest_get_with_token("/returns/state/#{return_id}")
27
- end
24
+ def get_return_by_id(return_id)
25
+ @client.rest_get_with_token("/returns/state/#{return_id}")
26
+ end
28
27
 
29
- def complete_return(return_id, body = {})
30
- @client.rest_put_with_token("/returns/#{return_id}/complete", body)
28
+ def complete_return(return_id, body = {})
29
+ @client.rest_put_with_token("/returns/#{return_id}/complete", body)
30
+ end
31
+ end
31
32
  end
32
33
  end
@@ -1,20 +1,23 @@
1
- require 'rest-client'
1
+ module Jet
2
+ class Client
3
+ # Taxonomy client
4
+ class Taxonomy
5
+ def initialize(client)
6
+ @client = client
7
+ end
2
8
 
3
- class Jet::Client::Taxonomy
4
- def initialize(client)
5
- @client = client
6
- end
7
-
8
- def get_links(limit, offset, version = "v1")
9
- params = { limit: limit, offset: offset }
10
- @client.rest_get_with_token("/taxonomy/links/#{version}", params)
11
- end
9
+ def get_links(limit, offset, version = 'v1')
10
+ params = { limit: limit, offset: offset }
11
+ @client.rest_get_with_token("/taxonomy/links/#{version}", params)
12
+ end
12
13
 
13
- def get_node(node_url)
14
- @client.rest_get_with_token(node_url)
15
- end
14
+ def get_node(node_url)
15
+ @client.rest_get_with_token(node_url)
16
+ end
16
17
 
17
- def get_node_attributes(node_url)
18
- @client.rest_get_with_token("#{node_url}/attributes")
18
+ def get_node_attributes(node_url)
19
+ @client.rest_get_with_token("#{node_url}/attributes")
20
+ end
21
+ end
19
22
  end
20
23
  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.8.0
4
+ version: 0.9.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: 2016-08-02 00:00:00.000000000 Z
11
+ date: 2017-06-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rest-client
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '2.15'
33
+ version: '3.0'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '2.15'
40
+ version: '3.0'
41
41
  description: Jet API service calls implemented in Ruby
42
42
  email:
43
43
  - flipstock@gmail.com
@@ -76,7 +76,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
76
76
  version: '0'
77
77
  requirements: []
78
78
  rubyforge_project:
79
- rubygems_version: 2.4.5
79
+ rubygems_version: 2.5.1
80
80
  signing_key:
81
81
  specification_version: 4
82
82
  summary: Jet API for Ruby