usps-imis-api 0.3.1.pre.3 → 0.3.1.pre.4
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/Gemfile.lock +1 -1
- data/lib/usps/imis/panel/vsc.rb +5 -25
- data/lib/usps/imis/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 02152b01fa56829c8909f1e62f80aab4df622c04927a7c9ba16583333058a065
|
4
|
+
data.tar.gz: 232ccd13227849b90a7ff923d5b450c2168de8848e38a233a509c53790ef8d62
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 16322a9dbb1a35fce4cded1e2ceac2cb40e0e5113c3fa47cef744c561e75ec9dd7243ff629193490e65f19f87a3999e22482dc797bddfdd5e8e18c94e408650a
|
7
|
+
data.tar.gz: 3ca39d83efaed93b7f08ceac76d98ab73b9bdbb6fb712498c623ec4a737217c4ad2f1cc66e2748aa9a0e7e46a32e35e83559796b1c2c98e252b9a21981ed8a7b
|
data/Gemfile.lock
CHANGED
data/lib/usps/imis/panel/vsc.rb
CHANGED
@@ -3,33 +3,13 @@
|
|
3
3
|
module Usps
|
4
4
|
module Imis
|
5
5
|
module Panel
|
6
|
-
class Vsc
|
7
|
-
|
8
|
-
|
9
|
-
attr_reader :api
|
10
|
-
|
11
|
-
def initialize(api = nil)
|
12
|
-
@api = api || Api.new
|
13
|
-
end
|
14
|
-
|
15
|
-
def get(ordinal)
|
16
|
-
api.get(BUSINESS_OBJECT, url_id: "~#{api.imis_id}|#{ordinal}")
|
17
|
-
end
|
18
|
-
|
19
|
-
def create(data)
|
20
|
-
api.post(BUSINESS_OBJECT, payload(data), url_id: '')
|
21
|
-
end
|
22
|
-
|
23
|
-
def update(data)
|
24
|
-
api.put(BUSINESS_OBJECT, payload(data), url_id: "~#{api.imis_id}|#{data[:ordinal]}")
|
25
|
-
end
|
6
|
+
class Vsc < BasePanel
|
7
|
+
private
|
26
8
|
|
27
|
-
def
|
28
|
-
|
9
|
+
def business_object
|
10
|
+
'ABC_ASC_Vessel_Safety_Checks'
|
29
11
|
end
|
30
12
|
|
31
|
-
private
|
32
|
-
|
33
13
|
# rubocop:disable Metrics/MethodLength
|
34
14
|
def payload(data)
|
35
15
|
identity_type =
|
@@ -44,7 +24,7 @@ module Usps
|
|
44
24
|
'EntityTypeName' => 'ABC_ASC_Vessel_Safety_Checks',
|
45
25
|
'IdentityElements' => {
|
46
26
|
'$type' => identity_type,
|
47
|
-
'$values' => [api.imis_id]
|
27
|
+
'$values' => [api.imis_id, data[:ordinal]&.to_s].compact
|
48
28
|
}
|
49
29
|
},
|
50
30
|
'PrimaryParentIdentity' => {
|
data/lib/usps/imis/version.rb
CHANGED