pubid-core 1.1.2 → 1.2.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: 452665bfc83c23fed5563fb65e94b05e003491474be0572c10628838bf9bb8d4
4
- data.tar.gz: 2c5282618c3bd1e04f26760791371205383191ab752878ac74ed32ac61ff6a2d
3
+ metadata.gz: 1e9bf3dd3d9bc2b650200a864109ae197ab92914d1badcbf211d414b9b72d535
4
+ data.tar.gz: 65ceef880cc4e59dfa4cd059cd2b57090cfee8400cf26717f6bd480d3a29b7db
5
5
  SHA512:
6
- metadata.gz: 57ec902835845daa759d264308e0456851e202a791d0f2dac62c6fb5253202741420f47c9c45f2a2a7398a691e3c17a61c6189ab01f177cbf2b46eb47be15d08
7
- data.tar.gz: ae150bad555421587020450b38fba534f1b94429ad7506ff6b32c0a0a4717be367ead10d5b5266259dbd4f9dfdc7a407e87acba122d7bd4f5562e643685c8a88
6
+ metadata.gz: 57670502ba1de60b88d0befb0933f990c37b3dd23544a5bd4889d2da0aea6086ea1d87032e9c547c2c5a9430037c3325d77149ebe36edf3a66c349ec3d734274
7
+ data.tar.gz: 1c9917b90d532faf17a601fea62ea18fe204098052b349b189067287877f29ba66dd2e244389b4b906d8772d33eced7aa2f204f61082a81aede616168e11b038
@@ -14,16 +14,34 @@ module Pubid::Core
14
14
  # @param edition [Integer] document's edition, eg. "1"
15
15
  # @param language [String] document's translation language
16
16
  # (available languages: "ru", "fr", "en", "ar")
17
- # @param amendments [Array<Amendment>] document's amendments
18
- # @param corrigendums [Array<Corrigendum>] document's corrigendums
17
+ # @param amendments [Array<Amendment>,Array<Hash>] document's amendments
18
+ # @param corrigendums [Array<Corrigendum>,Array<Hash>] document's corrigendums
19
19
  # @see Amendment
20
20
  # @see Corrigendum
21
21
  def initialize(publisher:, number:, copublisher: nil, part: nil, type: nil,
22
22
  year: nil, edition: nil, language: nil, amendments: nil,
23
23
  corrigendums: nil)
24
24
 
25
- @amendments = amendments
26
- @corrigendums = corrigendums
25
+ if amendments
26
+ @amendments = amendments.map do |amendment|
27
+ if amendment.is_a?(Hash)
28
+ self.class.get_transformer_class.new.apply(:amendments => [amendment])[:amendments].first
29
+ else
30
+ amendment
31
+ end
32
+ end
33
+ end
34
+
35
+ if corrigendums
36
+ @corrigendums = corrigendums.map do |corrigendum|
37
+ if corrigendum.is_a?(Hash)
38
+ self.class.get_transformer_class.new.apply(:corrigendums => [corrigendum])[:corrigendums].first
39
+ else
40
+ corrigendum
41
+ end
42
+ end
43
+ end
44
+
27
45
  @publisher = publisher.to_s
28
46
  @number = number
29
47
  @copublisher = copublisher if copublisher
@@ -1,5 +1,5 @@
1
1
  module Pubid
2
2
  module Core
3
- VERSION = "1.1.2".freeze
3
+ VERSION = "1.2.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.1.2
4
+ version: 1.2.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: 2022-09-04 00:00:00.000000000 Z
11
+ date: 2022-09-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake