relaton-nist 1.7.3 → 1.7.4

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: bac21983c91d40a755d2864bbdb1204be532f96822530ce5690b491e3d3afe0f
4
- data.tar.gz: 3343346d0bb0b16b90fc31dc79aa1d863ee81a9992245feb07731c53fef58e19
3
+ metadata.gz: e3f5d2a6df121410526e937f065b269da4da79a07a1f5262a825f2e1a9ff6a79
4
+ data.tar.gz: 5c6bf3f1fae325da2888c3c4323ce1ef8d98c52bde46a124c5b88fd6b8490eeb
5
5
  SHA512:
6
- metadata.gz: c1c0bab24222be0034927cc083b5914ce71e91deb638626f6f8f99a5c201705b92e639c666a1bcfe5056c955342eb480bfbc7f6543007e2675e53c7e07491825
7
- data.tar.gz: 99f20c825dff15d47d8a4a9b4d9e94af2d723353ae8f3950d7960df585edc61aeafefbe33cb42b44c810bf20717a34e62337094b816aa9d3cf3a55903b67c8ae
6
+ metadata.gz: c4f9f739ea073f0fae94f9a8ec9a792d82f618221fd3a6ecc345e9020b59159f1ef723ed5b933e0754d162c7a6c7ac1f64a07640f6d849f0224a684bd5686a5b
7
+ data.tar.gz: e3085821ff86c2b50d4953e4330395c999674b1fec7c290b88140576b1179cfae56f684269a010e20647ab530814d959c7685489ec11c04a5e7aabff036573d8
data/README.adoc CHANGED
@@ -154,11 +154,7 @@ hash = YAML.load_file 'spec/examples/nist_bib_item.yml'
154
154
  => {"id"=>"NISTIR 8011 Vol. 3",
155
155
  ...
156
156
 
157
- bib_hash = RelatonNist::HashConverter.hash_to_bib hash
158
- => {:id=>"NISTIR 8011 Vol. 3",
159
- ...
160
-
161
- RelatonNist::NistBibliographicItem.new bib_hash
157
+ RelatonNist::NistBibliographicItem.from_hash hash
162
158
  => #<RelatonNist::NistBibliographicItem:0x007f8b708505b8
163
159
  ...
164
160
  ----
@@ -63,6 +63,13 @@ module RelatonNist
63
63
  super
64
64
  end
65
65
 
66
+ # @param hash [Hash]
67
+ # @return [RelatonNist::GbBibliographicItem]
68
+ def self.from_hash(hash)
69
+ item_hash = RelatonNist::HashConverter.hash_to_bib(hash)
70
+ new **item_hash
71
+ end
72
+
66
73
  # @param opts [Hash]
67
74
  # @option opts [Nokogiri::XML::Builder] :builder XML builder
68
75
  # @option opts [Boolean] :bibdata
@@ -26,8 +26,7 @@ module RelatonNist
26
26
  # @param hash [Hash]
27
27
  # @return [RelatonNist::GbBibliographicItem]
28
28
  def hash_to_bib(hash)
29
- item_hash = ::RelatonNist::HashConverter.hash_to_bib(hash)
30
- ::RelatonNist::NistBibliographicItem.new item_hash
29
+ ::RelatonNist::NistBibliographicItem.from_hash hash
31
30
  end
32
31
 
33
32
  # Returns hash of XML grammar
@@ -1,3 +1,3 @@
1
1
  module RelatonNist
2
- VERSION = "1.7.3".freeze
2
+ VERSION = "1.7.4".freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: relaton-nist
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.3
4
+ version: 1.7.4
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
@@ -206,7 +206,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
206
206
  - !ruby/object:Gem::Version
207
207
  version: '0'
208
208
  requirements: []
209
- rubygems_version: 3.0.6
209
+ rubygems_version: 3.2.3
210
210
  signing_key:
211
211
  specification_version: 4
212
212
  summary: 'RelatonNist: retrive NIST standards.'