usps-imis-api 0.11.29 → 0.11.30
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/usps/imis/api.rb +10 -1
- data/lib/usps/imis/party_data.rb +5 -0
- 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: 4345384357bb8b467351a8ff24ee50254ff6fbac8ddf6f0997fd649618ec1a3d
|
|
4
|
+
data.tar.gz: 42f1878130b7c6f4535d1d05db21a085bb6c7bc7b70dd330b40ad1aee14fd017
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 470203f9820b54857e3ac8c590818e73b5df2634a0f1c4158d8d9ccc5fd795fd1da1253fba497370a9ea8c73d523a56ae33d6107b810b045baf3c7d20c858698
|
|
7
|
+
data.tar.gz: d69dfa364745a37bea6499edde90536288765441c90e4fab62666acf4071972a636e59a6178aa0d44eca35383fb3d055609c28fe7b84ee5ad6b25d34bbc81be6
|
data/lib/usps/imis/api.rb
CHANGED
|
@@ -62,6 +62,8 @@ module Usps
|
|
|
62
62
|
|
|
63
63
|
# Manually set the current ID, if you already have it for a given member
|
|
64
64
|
#
|
|
65
|
+
# Supports integer ID and UUID string
|
|
66
|
+
#
|
|
65
67
|
# @param id [Integer, String] iMIS ID to select for future requests
|
|
66
68
|
#
|
|
67
69
|
# @return [Integer] iMIS ID
|
|
@@ -69,7 +71,14 @@ module Usps
|
|
|
69
71
|
def imis_id=(id)
|
|
70
72
|
raise Errors::LockedIdError if lock_imis_id
|
|
71
73
|
|
|
72
|
-
|
|
74
|
+
hex = '[0-9a-fA-F]'
|
|
75
|
+
uuid_pattern = /^#{hex}{8}-#{hex}{4}-#{hex}{4}-#{hex}{4}-#{hex}{12}$/
|
|
76
|
+
@imis_id =
|
|
77
|
+
if id.to_s.match?(uuid_pattern)
|
|
78
|
+
id
|
|
79
|
+
elsif id.to_i.to_s == id.to_s
|
|
80
|
+
id.to_i
|
|
81
|
+
end
|
|
73
82
|
end
|
|
74
83
|
|
|
75
84
|
# Manually set the current record ID
|
data/lib/usps/imis/party_data.rb
CHANGED
|
@@ -20,6 +20,11 @@ module Usps
|
|
|
20
20
|
def imis_id = self['Id'].to_i
|
|
21
21
|
alias id imis_id
|
|
22
22
|
|
|
23
|
+
# Access the Uniform ID (uuid) property
|
|
24
|
+
#
|
|
25
|
+
def uniform_id = self['UniformId']
|
|
26
|
+
alias uuid uniform_id
|
|
27
|
+
|
|
23
28
|
# Access the certificate number
|
|
24
29
|
#
|
|
25
30
|
def certificate = self['AlternateIds'].find { it['IdType'] == 'MajorKey' }['Id']
|
data/lib/usps/imis/version.rb
CHANGED