pubid-core 1.1.1 → 1.1.2

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: 151e935e74a5977ef8728449d2e4f8a06175e38669a4394cfb561e330cacd051
4
- data.tar.gz: 5b70b9ca2ab35c264426478f6d747b70a9c67f4872f921006e77a5b20b039450
3
+ metadata.gz: 452665bfc83c23fed5563fb65e94b05e003491474be0572c10628838bf9bb8d4
4
+ data.tar.gz: 2c5282618c3bd1e04f26760791371205383191ab752878ac74ed32ac61ff6a2d
5
5
  SHA512:
6
- metadata.gz: 910b4449b492a78156b73a25f18fed85df8915b079e4ce09f3d7d5780aeb33e536a5347e289fb9ea69f8b4d7be5db719612deaf8e409e4199768524d0242c80a
7
- data.tar.gz: 663243db6546332315f0688879a57b3155e39c5f4c72941bb3a32201f262ca9254ae0045df8fba8bf0ecd705ded64d2ec1c277f78b0523a702632e0be0114c7e
6
+ metadata.gz: 57ec902835845daa759d264308e0456851e202a791d0f2dac62c6fb5253202741420f47c9c45f2a2a7398a691e3c17a61c6189ab01f177cbf2b46eb47be15d08
7
+ data.tar.gz: ae150bad555421587020450b38fba534f1b94429ad7506ff6b32c0a0a4717be367ead10d5b5266259dbd4f9dfdc7a407e87acba122d7bd4f5562e643685c8a88
@@ -1,36 +1,36 @@
1
1
  module Pubid::Core
2
2
  class Supplement
3
3
  include Comparable
4
- attr_accessor :version, :number
4
+ attr_accessor :number, :year
5
5
 
6
- # Creates new supplement with provided version and optional number
7
- # @param version [Integer]
6
+ # Creates new supplement with provided update number and optional year
8
7
  # @param number [Integer]
9
- def initialize(version:, number: nil)
10
- @version, @number = version&.to_i, number&.to_i
8
+ # @param year [Integer]
9
+ def initialize(number:, year: nil)
10
+ @number, @year = number&.to_i, year&.to_i
11
11
  end
12
12
 
13
13
  def <=>(other)
14
- return 0 if number.nil? && other.number
14
+ return 0 if year.nil? && other.year
15
15
 
16
- return number <=> other.number if version == other.version
16
+ return year <=> other.year if number == other.number
17
17
 
18
- (version <=> other.version) || number <=> other.number
18
+ (number <=> other.number) || year <=> other.year
19
19
  end
20
20
 
21
21
  def render_pubid_number
22
- if @number
23
- "#{@version}:#{@number}"
22
+ if @year
23
+ "#{@number}:#{@year}"
24
24
  else
25
- "#{@version}"
25
+ "#{@number}"
26
26
  end
27
27
  end
28
28
 
29
29
  def render_urn_number
30
- if @number
31
- ":#{@number}:v#{@version}"
30
+ if @year
31
+ ":#{@year}:v#{@number}"
32
32
  else
33
- ":#{@version}:v1"
33
+ ":#{@number}:v1"
34
34
  end
35
35
  end
36
36
  end
@@ -16,13 +16,13 @@ module Pubid::Core
16
16
  rule(amendments: subtree(:amendments)) do |context|
17
17
  if context[:amendments].is_a?(Array)
18
18
  context[:amendments] = context[:amendments].map do |amendment|
19
- self.class.get_amendment_class.new(version: amendment[:version], number: amendment[:number])
19
+ self.class.get_amendment_class.new(number: amendment[:number], year: amendment[:year])
20
20
  end
21
21
  else
22
22
  context[:amendments] =
23
23
  [self.class.get_amendment_class.new(
24
- version: context[:amendments][:version],
25
- number: context[:amendments][:number])]
24
+ number: context[:amendments][:number],
25
+ year: context[:amendments][:year])]
26
26
 
27
27
  end
28
28
  context
@@ -31,13 +31,13 @@ module Pubid::Core
31
31
  rule(corrigendums: subtree(:corrigendums)) do |context|
32
32
  if context[:corrigendums].is_a?(Array)
33
33
  context[:corrigendums] = context[:corrigendums].map do |corrigendum|
34
- self.class.get_corrigendum_class.new(version: corrigendum[:version], number: corrigendum[:number])
34
+ self.class.get_corrigendum_class.new(number: corrigendum[:number], year: corrigendum[:year])
35
35
  end
36
36
  else
37
37
  context[:corrigendums] =
38
38
  [self.class.get_corrigendum_class.new(
39
- version: context[:corrigendums][:version],
40
- number: context[:corrigendums][:number])]
39
+ number: context[:corrigendums][:number],
40
+ year: context[:corrigendums][:year])]
41
41
  end
42
42
  context
43
43
  end
@@ -1,5 +1,5 @@
1
1
  module Pubid
2
2
  module Core
3
- VERSION = "1.1.1".freeze
3
+ VERSION = "1.1.2".freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pubid-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.