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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ff08376f763d16ba1615aea1d4d072f25c31faf5586a255cbf500d920d5d0de0
4
- data.tar.gz: fdb80613eaf2d4448e9e7731001b276f3513a86de9c9e2b85718cd99df4aa738
3
+ metadata.gz: 4345384357bb8b467351a8ff24ee50254ff6fbac8ddf6f0997fd649618ec1a3d
4
+ data.tar.gz: 42f1878130b7c6f4535d1d05db21a085bb6c7bc7b70dd330b40ad1aee14fd017
5
5
  SHA512:
6
- metadata.gz: 9ea444e537b5f978c3017045faf126474f8f53d885c6a8c802d5f81051b738f5474a43fe4de2baad28a68b5365b5e929e73717ba08cb2183cbe8e020c88873aa
7
- data.tar.gz: ac58fcaef0547ae18db0170ca5ffb1370df2965b6f8563104d9d20ff986c892ad41fffd0bcf6764a80d8ebbf96ec8bbd33bb8354acadf6227384a8e4fcbe08bd
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
- @imis_id = id&.to_i
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
@@ -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']
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Usps
4
4
  module Imis
5
- VERSION = '0.11.29'
5
+ VERSION = '0.11.30'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: usps-imis-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.29
4
+ version: 0.11.30
5
5
  platform: ruby
6
6
  authors:
7
7
  - Julian Fiander