relaton-iho 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: ee5d54b17a125e06b71aeefcee593ee66b7c44d70677b9e54f7b56cd05f88009
4
- data.tar.gz: 5e128ecc1b7ce4251aa05f59975de37468b32dcf8ac925cbee2595aa9b82186a
3
+ metadata.gz: 61320ca932f5b001e0ee77ba3f8372f47955a9c066f80a63fa87b9b1d3cc4377
4
+ data.tar.gz: ed1e7270d08a2c8bbc18ca6452310a44a4ae09c24b813f16482f7998b1936f32
5
5
  SHA512:
6
- metadata.gz: 6e1ddc54b6c238d9e0813a01480b2b6ad1cde81dd24f0bd0f8904831827a1fa1fb9807af0a408385c4d08ced8bd2649b5224b53eddc469363fcf11bcdd954ec6
7
- data.tar.gz: 568d8f685c48d40c4663b784b277be234ebbd97d59e2c53e52aff514ccbabda2909e037b0d7893e9b291a602aa34a0278693bbdd92d1decad988d39916c31630
6
+ metadata.gz: cd79eaa7e5d7dbcceca170fbff4d6859ccabd8059f43f4ff974e3ac5d9bde0f23269af77b7402783194a4f46a08237f711006b87cbc46ab570f778cc58c45850
7
+ data.tar.gz: 206d9a1d25fa364fdbfa578b75b9b2dc020bdb5f1bcb1fa6c53cddb7064f78f35b6ffbfc36198cd55b0a08cd63c97bdf1fadd0fca4a3f4499701566cf7e27cb7
data/README.adoc CHANGED
@@ -119,11 +119,7 @@ hash = YAML.load_file 'spec/fixtures/iho.yaml'
119
119
  => {"id"=>"B-11",
120
120
  ...
121
121
 
122
- bib_hash = RelatonIho::HashConverter.hash_to_bib hash
123
- => {:id=>"B-11",
124
- ...
125
-
126
- RelatonIho::IhoBibliographicItem.new bib_hash
122
+ RelatonIho::IhoBibliographicItem.from_hash hash
127
123
  => #<RelatonIho::IhoBibliographicItem:0x007fc322ef8548
128
124
  ...
129
125
  ----
@@ -13,6 +13,13 @@ module RelatonIho
13
13
  super
14
14
  end
15
15
 
16
+ # @param hash [Hash]
17
+ # @return [RelatonIho::IhoBibliographicItem]
18
+ def self.from_hash(hash)
19
+ item_hash = ::RelatonIho::HashConverter.hash_to_bib(hash)
20
+ new **item_hash
21
+ end
22
+
16
23
  # @param opts [Hash]
17
24
  # @option opts [Nokogiri::XML::Builder] :builder XML builder
18
25
  # @option opts [Boolean] :bibdata
@@ -28,8 +28,7 @@ module RelatonIho
28
28
  # @param hash [Hash]
29
29
  # @return [RelatonIho::IhoBibliographicItem]
30
30
  def hash_to_bib(hash)
31
- item_hash = ::RelatonIho::HashConverter.hash_to_bib(hash)
32
- ::RelatonIho::IhoBibliographicItem.new item_hash
31
+ ::RelatonIho::IhoBibliographicItem.new hash
33
32
  end
34
33
 
35
34
  # Returns hash of XML grammar
@@ -1,3 +1,3 @@
1
1
  module RelatonIho
2
- VERSION = "1.7.1".freeze
2
+ VERSION = "1.7.2".freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: relaton-iho
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: bin
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: byebug