pubid-core 1.10.3 → 1.11.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/pubid/core/entity.rb +11 -0
- data/lib/pubid/core/identifier/base.rb +4 -4
- data/lib/pubid/core/version.rb +1 -1
- data/lib/pubid/core.rb +1 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0b73ed4ff507dfe5cb2c7b506eaa392ef6fbf3af9b2ff0d500151a430d0a8d2c
|
4
|
+
data.tar.gz: 46108a14c2cbb1446085668ab46a8b60837e596a8a893f2f2731a2b247c6d7c2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 93fcaaf9757fc059fe26cfd9506c5d42806e56e6f1abd1a86d2464abdfcb64cba933e777813d988e06abe997099504a5e8f632fe08784c926fea105916301643
|
7
|
+
data.tar.gz: d84b1ac6d760d5de765e87e041ad82a5dd7c76c762f69cb5a56074376981d7a0a13929162a462fd421144c1042042a51eae1c9cbb51433b7a4c9f377713d8ea5
|
@@ -63,17 +63,17 @@ module Pubid::Core
|
|
63
63
|
end
|
64
64
|
|
65
65
|
# @return [Hash] Identifier's parameters
|
66
|
-
def to_h
|
66
|
+
def to_h(deep: true)
|
67
67
|
instance_variables.map do |var|
|
68
68
|
value = instance_variable_get(var)
|
69
69
|
|
70
70
|
[var.to_s.gsub("@", "").to_sym,
|
71
71
|
if value.is_a?(Array)
|
72
|
-
value.map { |v| v.respond_to?(:to_h) ? v.to_h : v }
|
72
|
+
value.map { |v| (v.respond_to?(:to_h) && deep) ? v.to_h : v }
|
73
73
|
elsif value.nil?
|
74
74
|
nil
|
75
75
|
else
|
76
|
-
value.respond_to?(:to_h) ? value.to_h : value
|
76
|
+
(value.respond_to?(:to_h) && deep) ? value.to_h : value
|
77
77
|
end
|
78
78
|
]
|
79
79
|
end.to_h
|
@@ -85,7 +85,7 @@ module Pubid::Core
|
|
85
85
|
|
86
86
|
# Render identifier using default renderer
|
87
87
|
def to_s
|
88
|
-
self.class.get_renderer_class.new(to_h).render
|
88
|
+
self.class.get_renderer_class.new(to_h(deep: false)).render
|
89
89
|
end
|
90
90
|
|
91
91
|
def exclude(*attrs)
|
data/lib/pubid/core/version.rb
CHANGED
data/lib/pubid/core.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pubid-core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.11.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-11-
|
11
|
+
date: 2023-11-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -68,6 +68,7 @@ files:
|
|
68
68
|
- lib/pubid/core/amendment.rb
|
69
69
|
- lib/pubid/core/configuration.rb
|
70
70
|
- lib/pubid/core/corrigendum.rb
|
71
|
+
- lib/pubid/core/entity.rb
|
71
72
|
- lib/pubid/core/errors.rb
|
72
73
|
- lib/pubid/core/harmonized_stage_code.rb
|
73
74
|
- lib/pubid/core/identifier.rb
|