uc3-dmp-id 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/uc3-dmp-id/helper.rb +24 -0
- data/lib/uc3-dmp-id/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: ab1c5afc33fa7cf9bafbc4a62a282a0674cdbe81c47566865789db74fc411ea3
|
4
|
+
data.tar.gz: 16521d303406e294953b43108abb65b8e7af94d635a782e8008db91cae6e4c96
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fbf1707d4052898f39ad30f06979f1218951f02bf24833669ff4743957a4e404278fe8112b791a5bef9f27d99e9081a267ee135a283467e77ea894143607ac43
|
7
|
+
data.tar.gz: bfc2e024b3f73980302f2d8e3a15d945a541129ed02286b6f052371489f48a97e6af4eec31e46669169157035bacc28acd89954db1e5b3ea407647f35c907b5c
|
data/lib/uc3-dmp-id/helper.rb
CHANGED
@@ -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/')
|
data/lib/uc3-dmp-id/version.rb
CHANGED