relaton-gb 1.7.1 → 1.7.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: 6bace1b7a804bd668e60000515fdfc8b5d63264507f15962b89d01748a44282c
4
- data.tar.gz: ba2cd2c3fe33796d692bbbe9be87fa00c2402367d99e8ea06f0d8e596976180a
3
+ metadata.gz: 7ac8b9933487805e76e9a8f6b6665bb9676d20a2db80ea40ccca2c5e2adda200
4
+ data.tar.gz: fbafee3ab69c7f5f39eb902e6378d185b80aa187c8a737f87b38d280db77da3d
5
5
  SHA512:
6
- metadata.gz: 8d3f12296ffec4cd1684859be82b743328f64dabdac64b3db8a36f3006f780562a4244b67e1aabc4eef992d5e4da991b2d7ee7fededfdb9c2df2ac1cb78f85ff
7
- data.tar.gz: 3e4cedf195effcb9a3bbb53f6dc758e4dcd1c8ae4a2753f041b3d10eab7136d255de35b1173221a3fa4a94b8369ad360fee6a7810f22795262b547de30f09807
6
+ metadata.gz: d3f8fc4e6f4b4bd50c8c4f6f744e2b48b7b26d13855135a3198254c245fe1d7004932e3d77edb00a7c67a80a2bc058d256cbb6694c55caf79bbe815488568e8e
7
+ data.tar.gz: d55ce1c07766a9a1d80b116aeff2c0efedbf161afbc8ae47bcafc47f3db0a2ec68660239b8449aba15157a5eecb3f4ed3a94364a30c636aaf000b26319b64d09
data/README.adoc CHANGED
@@ -100,11 +100,7 @@ hash = YAML.load_file 'spec/examples/gb_bib_item.yml'
100
100
  => {"id"=>"JB/T13368",
101
101
  ...
102
102
 
103
- bib_hash = RelatonGb::HashConverter.hash_to_bib hash
104
- => {:id=>"JB/T13368",
105
- ...
106
-
107
- RelatonGb::GbBibliographicItem.new bib_hash
103
+ RelatonGb::GbBibliographicItem.from_hash hash
108
104
  => <RelatonGb::GbBibliographicItem:0x007fc680802700>
109
105
  ----
110
106
 
@@ -38,6 +38,13 @@ module RelatonGb
38
38
  structuredidentifier&.project_number
39
39
  end
40
40
 
41
+ # @param hash [Hash]
42
+ # @return [RelatonGb::GbBibliographicItem]
43
+ def self.from_hash(hash)
44
+ item_hash = ::RelatonGb::HashConverter.hash_to_bib(hash)
45
+ new **item_hash
46
+ end
47
+
41
48
  # @param opts [Hash]
42
49
  # @option opts [Nokogiri::XML::Builder] :builder XML builder
43
50
  # @option opts [Boolean] :bibdata
@@ -28,8 +28,7 @@ module RelatonGb
28
28
  # @param hash [Hash]
29
29
  # @return [RelatonGb::GbBibliographicItem]
30
30
  def hash_to_bib(hash)
31
- item_hash = ::RelatonGb::HashConverter.hash_to_bib(hash)
32
- ::RelatonGb::GbBibliographicItem.new item_hash
31
+ ::RelatonGb::GbBibliographicItem.new hash
33
32
  end
34
33
 
35
34
  # Returns hash of XML grammar
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RelatonGb
4
- VERSION = "1.7.1"
4
+ VERSION = "1.7.2"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: relaton-gb
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.1
4
+ version: 1.7.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-03-18 00:00:00.000000000 Z
11
+ date: 2021-03-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: equivalent-xml