wes-data-api 4.2.0 → 4.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: 5be436c59614328b3b57c18dfe57aa903d6f5a37
4
- data.tar.gz: 1bd0512febe063221cc1a6bb3e01f49a302a0681
3
+ metadata.gz: 4c086f2ba3fe42785471339e64cd50e46b325151
4
+ data.tar.gz: 149a7a0338e401c38435ccb8187bdef974fb42b3
5
5
  SHA512:
6
- metadata.gz: da7d5cd95360e172d0ee86830ade337946c2220dc99e0105a17ff9bbe89876d99345c34f0f19fbb18991639d0adcfa82bb65162a3a738b21b6fc944859b74402
7
- data.tar.gz: 7d6b7730ba38868ada080dfc56bfb3e22a02d4ec82eed63ee47a2d5c55a5f79f7369669a6eb950d0e3864a3e28dd219ef1814dd4b43ee1bd8d9ca9ea76d42cb2
6
+ metadata.gz: 756774fe9327276bab8c5e6fa135f5d089a30dfe800e87d86642a3768931b1057d98cf798f2c22d61235b076861735ea27f2c1ad99d26d561656270f09cb2125
7
+ data.tar.gz: cb52a08709876e42cb6dcaa23aab8e582e2f645d1863400852797e71974361e13aecd1f922e714e4ce0f3c418535339a8b3278cfbbd26efc451b920d1d964382
@@ -5,7 +5,7 @@ require "wes/data/api/configuration"
5
5
  module Wes
6
6
  module Data
7
7
  module API
8
- VERSION = "4.2.0".freeze
8
+ VERSION = "4.3.0".freeze
9
9
  end
10
10
  end
11
11
  end
@@ -10,12 +10,12 @@ module Wes
10
10
 
11
11
  def create(data)
12
12
  attributes = client.post(routes.billing, data).first
13
- model_klass.new(attributes)
13
+ attributes.nil? ? nil : model_klass.new(attributes)
14
14
  end
15
15
 
16
16
  def find(key, value)
17
17
  attributes = client.get(find_route(key, value)).first
18
- model_klass.new(attributes)
18
+ attributes.nil? ? nil : model_klass.new(attributes)
19
19
  end
20
20
 
21
21
  private
@@ -25,7 +25,7 @@ module Wes
25
25
  when :id
26
26
  [routes.billing, value].join("/")
27
27
  when :user_id
28
- [routes.billing, value, routes.billing].join("/")
28
+ [routes.user, value, routes.billing].join("/")
29
29
  end
30
30
  end
31
31
 
@@ -15,7 +15,7 @@ module Wes
15
15
  def find(_key, value)
16
16
  route = [routes.brand, value].join("/")
17
17
  attributes = client.get(route).first
18
- model_klass.new(attributes)
18
+ attributes.nil? ? nil : model_klass.new(attributes)
19
19
  end
20
20
 
21
21
  private
@@ -8,12 +8,6 @@ module Wes
8
8
  class << self
9
9
  include Base
10
10
 
11
- def find(_key, value)
12
- route = [routes.challenge, value].join("/")
13
- attributes = client.get(route).first
14
- model_klass.new(attributes)
15
- end
16
-
17
11
  def all(state = nil)
18
12
  route = add_state(routes.challenges, state)
19
13
  map_objects(
@@ -21,6 +15,12 @@ module Wes
21
15
  )
22
16
  end
23
17
 
18
+ def find(_key, value)
19
+ route = [routes.challenge, value].join("/")
20
+ attributes = client.get(route).first
21
+ attributes.nil? ? nil : model_klass.new(attributes)
22
+ end
23
+
24
24
  private
25
25
 
26
26
  def model_klass
@@ -37,7 +37,7 @@ module Wes
37
37
  TIMEOUT = 2
38
38
 
39
39
  def complete_path(path)
40
- ["/", version, path].join("/")
40
+ ["", version, path].join("/")
41
41
  end
42
42
 
43
43
  def configuration
@@ -10,13 +10,13 @@ module Wes
10
10
 
11
11
  def create(options)
12
12
  attributes = client.post(routes.submission, options).first
13
- model_klass.new(attributes)
13
+ attributes.nil? ? nil : model_klass.new(attributes)
14
14
  end
15
15
 
16
16
  def find(_key, value)
17
17
  route = [routes.submission, value].join("/")
18
18
  attributes = client.get(route).first
19
- model_klass.new(attributes)
19
+ attributes.nil? ? nil : model_klass.new(attributes)
20
20
  end
21
21
 
22
22
  private
@@ -17,12 +17,12 @@ module Wes
17
17
  def create(id)
18
18
  route = [routes.user, id].join("/")
19
19
  attributes = client.post(route).first
20
- model_klass.new(attributes)
20
+ attributes.nil? ? nil : model_klass.new(attributes)
21
21
  end
22
22
 
23
23
  def find(key, value)
24
24
  attributes = client.get(find_route(key, value)).first
25
- model_klass.new(attributes)
25
+ attributes.nil? ? nil : model_klass.new(attributes)
26
26
  end
27
27
 
28
28
  private
@@ -10,7 +10,7 @@ module Wes
10
10
 
11
11
  def create(options)
12
12
  attributes = client.post(routes.video, options).first
13
- model_klass.new(attributes)
13
+ attributes.nil? ? nil : model_klass.new(attributes)
14
14
  end
15
15
 
16
16
  private
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: 4.2.0
4
+ version: 4.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - ''