relaton-iec 1.7.7 → 1.7.8

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: 6adf6dcf2372c1e9dff549a4d4145fcbbd9bd1aced1924183a30d5253a760757
4
- data.tar.gz: 26065c6b757cd9e1818568f6ef07b83041ea3e10cf4f6c331925c807a8c22c50
3
+ metadata.gz: fbb0f0c060c611ed09b0bfb72313ebc933dce55cd7ea5063e55e4329e683d4ea
4
+ data.tar.gz: 05b97bda3a0f1815beda4437248434b26e539e52905b53e724d1dbbeedb1e890
5
5
  SHA512:
6
- metadata.gz: d6c2a5cb8df0993d39c2d150f1f1abc6cddfe0b6ddc88e0ff3f309603de964eccf4242dc273c89659fcfd4323a73b8ecbcc152d9203bcdadc618df5171313f47
7
- data.tar.gz: b76ea74bdf8204c525d8db77b03d53157a26ae0f797edfb5be908b33c28c426add2de763e51ee92a98b778e64084230ea699b4c2a79420cb3166c72be7308b9f
6
+ metadata.gz: 637d0b99821d7a2ec94b853064cb7958028e79a3855524707677ebc711879713f3d4ef34d6df699d5f3c9b1b3644f11edf342b6e9baaaa90deea6be53478e183
7
+ data.tar.gz: d3e445689acae837e55f7b92fb95cb52a97afa23813d908d3bf41b8e82a77077e55d67bf51b181590d9b2c883e958ccdf07047cff6436404aa735537ffa78ce2
data/README.adoc CHANGED
@@ -184,6 +184,19 @@ item.to_xml note: [{ text: "Note", type: "note" }]
184
184
  </bibitem>"
185
185
  ----
186
186
 
187
+ === Create bibliography item from hash
188
+
189
+ [source,ruby]
190
+ ----
191
+ hash = YAML.load_file "spec/examples/hit.yaml"
192
+ => {"id"=>"IEC61058-2-4-1995+AMD1-2003CSV",
193
+ ...
194
+
195
+ RelatonIec::IecBibliographicItem.from_hash hash
196
+ => #<RelatonIec::IecBibliographicItem:0x00007fe16f032d40
197
+ ...
198
+ ----
199
+
187
200
  === Converting reference to URN
188
201
 
189
202
  URN is document a identifier format. It has fields delimited by colon. If any field is absent then it's place is empty. All values are in lower-case.
@@ -5,5 +5,12 @@ module RelatonIec
5
5
  publicly-available-specification international-workshop-agreement
6
6
  guide
7
7
  ].freeze
8
+
9
+ # @param hash [Hash]
10
+ # @return [RelatonIsoBib::IecBibliographicItem]
11
+ def self.from_hash(hash)
12
+ item_hash = ::RelatonIec::HashConverter.hash_to_bib(hash)
13
+ new **item_hash
14
+ end
8
15
  end
9
16
  end
@@ -26,8 +26,7 @@ module RelatonIec
26
26
  # @param hash [Hash]
27
27
  # @return [RelatonIsoBib::IecBibliographicItem]
28
28
  def hash_to_bib(hash)
29
- item_hash = ::RelatonIec::HashConverter.hash_to_bib(hash)
30
- ::RelatonIec::IecBibliographicItem.new item_hash
29
+ ::RelatonIec::IecBibliographicItem.from_hash hash
31
30
  end
32
31
 
33
32
  # Returns hash of XML grammar
@@ -1,3 +1,3 @@
1
1
  module RelatonIec
2
- VERSION = "1.7.7".freeze
2
+ VERSION = "1.7.8".freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: relaton-iec
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.7
4
+ version: 1.7.8
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-17 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