wes-data-api 5.2.1 → 5.2.2
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 +4 -4
- data/lib/wes/data/api.rb +1 -1
- data/lib/wes/data/api/model/base.rb +10 -10
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 1fe688c06b5617dcebca4a42a19e95f2745c72c0
|
|
4
|
+
data.tar.gz: 9341c7aa61fbdf3c0e8fddc94c1354f63049e73c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 64e4203f46273b1c30d43bd3f2e0529df25b219ea70f582dd989f48cb2ea3c75af683b3ddbe1d3b8041d426c209287b77f38a800bcb85e6c58ee0296a344e190
|
|
7
|
+
data.tar.gz: b4f03437bc30bef242b93ea7cd9d5fdd48256c6874766497b251b9bde58e56974c2c8c344f6f64be8dcf0749308c28632b8bc0bcff166f7d3412822dd3133a29
|
data/lib/wes/data/api.rb
CHANGED
|
@@ -3,8 +3,6 @@ module Wes
|
|
|
3
3
|
module API
|
|
4
4
|
module Model
|
|
5
5
|
class Base
|
|
6
|
-
protected
|
|
7
|
-
|
|
8
6
|
attr_reader :attributes
|
|
9
7
|
|
|
10
8
|
def initialize(attributes)
|
|
@@ -12,6 +10,16 @@ module Wes
|
|
|
12
10
|
id_set?
|
|
13
11
|
end
|
|
14
12
|
|
|
13
|
+
def exist?
|
|
14
|
+
!attributes.nil?
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
def id
|
|
18
|
+
attributes.id
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
protected
|
|
22
|
+
|
|
15
23
|
def add_state(route, state)
|
|
16
24
|
return route unless state
|
|
17
25
|
"#{route}/#{state}"
|
|
@@ -25,14 +33,6 @@ module Wes
|
|
|
25
33
|
Configuration
|
|
26
34
|
end
|
|
27
35
|
|
|
28
|
-
def exist?
|
|
29
|
-
!attributes.nil?
|
|
30
|
-
end
|
|
31
|
-
|
|
32
|
-
def id
|
|
33
|
-
attributes.id
|
|
34
|
-
end
|
|
35
|
-
|
|
36
36
|
def map_objects(records, klass)
|
|
37
37
|
records.map { |r| klass.new(r) }
|
|
38
38
|
end
|