wes-data-api 1.4.0 → 1.5.0

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: 0cb074f5605b7ce3caa0db90d40c3cbf4e8b5302
4
- data.tar.gz: e1167522705d5bb19fcfd6d2f0a4d4fda18acd6f
3
+ metadata.gz: bf54b7a106c5f130ac21a1580bf48f9cb7f89ceb
4
+ data.tar.gz: e47f74772605faa8388618f9003a84469ec51095
5
5
  SHA512:
6
- metadata.gz: 8ae7c2baffe799cdcc173336e09def722039d882497a36b151103e49edcdbc5706fc3dbebb99d4661249b13b06f45256277bfa18e87b2793a7d3e5282d6e2026
7
- data.tar.gz: 270cee484913b9956c7382a08c6c8519ce5e8d5139204a0c0607946f81d1de9ccedfa11b80e01effdf330e29f00474a54664c837ee5f88c48ece836e58ad7cdf
6
+ metadata.gz: d9b6f557badb75ae2cd03c95c7db9eab800be42e7efdd8beb77a645f3df9c6123719fb6481e76ac8f77f66b5928096fe4c16dea0d1ad9d592ccf9e393b448e68
7
+ data.tar.gz: d13d4b04fc0a8de911c1b44a246198bbdfbcaacd8b323377aac2e82777df79f242e5f3e2731b5b8b745df8281bd6dc915b4131a4f0e93da20302d56ae65b6a1c
@@ -15,6 +15,11 @@ module Wes
15
15
  response api_response
16
16
  end
17
17
 
18
+ def put(path, options)
19
+ api_response = request.put(path, options)
20
+ response api_response
21
+ end
22
+
18
23
  private
19
24
 
20
25
  def request
@@ -14,6 +14,10 @@ module Wes
14
14
  new.post(path, options)
15
15
  end
16
16
 
17
+ def self.put(path, options = {})
18
+ new.put(path, options)
19
+ end
20
+
17
21
  def get(path)
18
22
  connection.get do |r|
19
23
  r.url complete_path(path)
@@ -30,6 +34,15 @@ module Wes
30
34
  end
31
35
  end
32
36
 
37
+ def put(path, options)
38
+ connection.put do |r|
39
+ r.body = options.to_json
40
+ r.headers["Content-Type"] = "application/json"
41
+ r.url complete_path(path)
42
+ r.options.timeout = TIMEOUT
43
+ end
44
+ end
45
+
33
46
  private
34
47
 
35
48
  TIMEOUT = 2
@@ -31,7 +31,7 @@ module Wes
31
31
 
32
32
  def update_metadata(new_metadata)
33
33
  check_for_id!
34
- client.post(
34
+ client.put(
35
35
  "#{routes.user}/#{id}#{routes.metadata}",
36
36
  metadata.first.to_h.merge(new_metadata)
37
37
  ).first
@@ -1,7 +1,7 @@
1
1
  module Wes
2
2
  module Data
3
3
  module API
4
- VERSION = "1.4.0".freeze
4
+ VERSION = "1.5.0".freeze
5
5
  end
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wes-data-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.0
4
+ version: 1.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - ''