uc3-dmp-id 0.0.5 → 0.0.6

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: fb6a21e1fcad936e84cad2d4067084a823104c99d68c4acf037a623c01fcf55e
4
- data.tar.gz: 01256a0949cc0625912d4c86309375f4c9abfd4ff9d3b5c6f713c798d70161ac
3
+ metadata.gz: ab1c5afc33fa7cf9bafbc4a62a282a0674cdbe81c47566865789db74fc411ea3
4
+ data.tar.gz: 16521d303406e294953b43108abb65b8e7af94d635a782e8008db91cae6e4c96
5
5
  SHA512:
6
- metadata.gz: b7fec6aaddcd4f9d8029731c37a0363e55a1a66679a0359c07662c1f12fdc1d213695fa5a67f4c25e5a0fb059cd9cd3b195f7c7fd14beb771bf23a2f4fd1f19f
7
- data.tar.gz: 51e8b4a4d987673b551a3b53b435ec057f61f1b43e10d6829a26977d1c7af1d1db3d7ea1ed61f140903288fc9b766841ebfb30ed4b2ed7244ed2caad3b4269c8
6
+ metadata.gz: fbf1707d4052898f39ad30f06979f1218951f02bf24833669ff4743957a4e404278fe8112b791a5bef9f27d99e9081a267ee135a283467e77ea894143607ac43
7
+ data.tar.gz: bfc2e024b3f73980302f2d8e3a15d945a541129ed02286b6f052371489f48a97e6af4eec31e46669169157035bacc28acd89954db1e5b3ea407647f35c907b5c
@@ -22,6 +22,30 @@ module Uc3DmpId
22
22
  DMP_TOMBSTONE_VERSION = "#{SK_DMP_PREFIX}tombstone"
23
23
 
24
24
  class << self
25
+ # Append the PK prefix for the object
26
+ # -------------------------------------------------------------------------------------
27
+ def append_pk_prefix(p_key:)
28
+ p_key.is_a?(String) ? "#{PK_DMP_PREFIX}#{remove_pk_prefix(p_key: p_key)}" : nil
29
+ end
30
+
31
+ # Strip off the PK prefix
32
+ # -------------------------------------------------------------------------------------
33
+ def remove_pk_prefix(p_key:)
34
+ p_key.is_a?(String) ? p_key.gsub(PK_DMP_PREFIX, '') : p_key
35
+ end
36
+
37
+ # Append the SK prefix for the object
38
+ # -------------------------------------------------------------------------------------
39
+ def append_sk_prefix(s_key:)
40
+ s_key.is_a?(String) ? "#{SK_DMP_PREFIX}#{remove_pk_prefix(s_key: s_key)}" : nil
41
+ end
42
+
43
+ # Strip off the SK prefix
44
+ # -------------------------------------------------------------------------------------
45
+ def remove_sk_prefix(s_key:)
46
+ s_key.is_a?(String) ? s_key.gsub(SK_DMP_PREFIX, '') : s_key
47
+ end
48
+
25
49
  # Return the base URL for a DMP ID
26
50
  def dmp_id_base_url
27
51
  url = ENV.fetch('DMP_ID_BASE_URL', 'https://dmptool-dev.cdlib.org/dmps/')
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Uc3DmpId
4
- VERSION = '0.0.5'
4
+ VERSION = '0.0.6'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: uc3-dmp-id
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Riley