pubid-core 1.8.7 → 1.9.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 65c153405bb8ae343ef26b9943f013864d2db8fd2abfd27e14d2db1f83de4d0a
4
- data.tar.gz: 1ebdf5cef55a9c09111f18245a9d6767ee8107d7039398e8aaa9ceb8f5e0e9d5
3
+ metadata.gz: c8fa90c212d201a964cf2744e9c8bcba06af62d10dfe195caa6af284189b82cd
4
+ data.tar.gz: 9d526bcae7afe9781b462aabd17fe3bbaafb1349e3b40c5f5fc6364468dce76d
5
5
  SHA512:
6
- metadata.gz: ff849c54be9d3e4b49a54c48fd58413b66fe0f2aae40f7735c62820fe064e08fdb77b9e197b21a3471dd14570b4875223dce065ae3e5333b614beb520c171bae
7
- data.tar.gz: d649815ce64e1654b64681d1a183c6309759403738fff8d270ca01effe4a87d4a9e0e7e82f8468bbc7fe15c9717d2e0024e6268a16571eaba71620f0398ead6b
6
+ metadata.gz: bd9862d64043e894cd11ab5a92f5e792377dc28d1986918799e809c06070504e16f1be6fcecac05da3f366e52e2266476ff4733664ba3427a03f87b5a4ba8c4d
7
+ data.tar.gz: b0962ace109243f800c6c17ceacde35cc50f345c952dd75b9af42045d03dbf961a72cb4d42b3585f4c1a98ecc7a035795614c45c7e83ca48bd18160c11f573d6
@@ -59,10 +59,11 @@ module Pubid::Core
59
59
 
60
60
  # @return [String] Rendered URN identifier
61
61
  def urn
62
- Renderer::Urn.new(get_params).render
62
+ Renderer::Urn.new(to_h).render
63
63
  end
64
64
 
65
- def get_params
65
+ # @return [Hash] Identifier's parameters
66
+ def to_h
66
67
  instance_variables.map do |var|
67
68
  # XXX: temporary hack to prepare typed_stage for rendering
68
69
  # probably need to convert typed_stage to class, now we store
@@ -76,12 +77,12 @@ module Pubid::Core
76
77
  end
77
78
 
78
79
  def ==(other)
79
- get_params == other.get_params
80
+ to_h == other.to_h
80
81
  end
81
82
 
82
83
  # Render identifier using default renderer
83
84
  def to_s
84
- self.class.get_renderer_class.new(get_params).render
85
+ self.class.get_renderer_class.new(to_h).render
85
86
  end
86
87
 
87
88
  def typed_stage_abbrev
@@ -44,9 +44,9 @@ module Pubid::Core::Renderer
44
44
  def render_supplement(supplement_params, **args)
45
45
  base = if supplement_params[:base].type == :amd
46
46
  # render inner amendment (cor -> amd -> base)
47
- render_supplement(supplement_params[:base].get_params, **args)
47
+ render_supplement(supplement_params[:base].to_h, **args)
48
48
  else
49
- self.class.new(supplement_params[:base].get_params).render_base_identifier(
49
+ self.class.new(supplement_params[:base].to_h).render_base_identifier(
50
50
  # always render year for identifiers with supplement
51
51
  **args.merge({ with_date: true }),
52
52
  )
@@ -1,5 +1,5 @@
1
1
  module Pubid
2
2
  module Core
3
- VERSION = "1.8.7".freeze
3
+ VERSION = "1.9.0".freeze
4
4
  end
5
5
  end
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.8.7
4
+ version: 1.9.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-08-25 00:00:00.000000000 Z
11
+ date: 2023-10-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake