relaton-ietf 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: 4f79e05f6c3ea764d30694b945d349625d9e023ebca7d754ddbf1a6466d5896f
4
- data.tar.gz: 16f1b368cfa752535524182dc46d6e44cb2ab2f6a480b770b3c0f4ba768cdc09
3
+ metadata.gz: f7b4e48f7bfedc080ef41fa038f678b702a45a500637e71be5444b87b74d460b
4
+ data.tar.gz: c8ccfe769f17ef85df427835b4f1116f125453b99b2f20ea29f97f74b9d39654
5
5
  SHA512:
6
- metadata.gz: 9d3d895cc60025239a91da3453f44043974a40c3e4aab4fe8bad025a501822ef9ed726735f56fb29730ae26329dfe2c2195927c814a24b2048fd0ce8c101bb85
7
- data.tar.gz: b529a89d577098a73b31d9335f685928e10478622477608962108a3779a074842486f7c6c882317f1f0cedd2faa9dbb6affafc37152028f9ead1033a863758f4
6
+ metadata.gz: ab65e6e326efce9ebdff092f34814e774f73388aef294ab1b96e2286ffcaca74a7bd69d4c0701bf85beba62b6a3e5c9a3eacddf854566649f8e224634e07e303
7
+ data.tar.gz: e8624b553831ccbcefbbb4385127c75f9535b4f2d3d786af5ab040ec1d75a3509813fb6cdc269df26a24b91f223f166edb015682507ae61d30df89c672a2d4c4
data/README.adoc CHANGED
@@ -102,11 +102,7 @@ hash = YAML.load_file 'spec/examples/ietf_bib_item.yml'
102
102
  => {"id"=>"RFC 8341",
103
103
  ...
104
104
 
105
- bib_hash = RelatonIetf::HashConverter.hash_to_bib hash
106
- => {:id=>"RFC 8341",
107
- ...
108
-
109
- RelatonIetf::IetfBibliographicItem.new bib_hash
105
+ RelatonIetf::IetfBibliographicItem.from_hash hash
110
106
  => #<RelatonIetf::IetfBibliographicItem:0x007f9a929dde40
111
107
  ...
112
108
  ----
@@ -17,6 +17,13 @@ module RelatonIetf
17
17
  super
18
18
  end
19
19
 
20
+ # @param hash [Hash]
21
+ # @return [RelatonIetf::IetfBibliographicItem]
22
+ def self.from_hash(hash)
23
+ item_hash = ::RelatonIetf::HashConverter.hash_to_bib(hash)
24
+ new **item_hash
25
+ end
26
+
20
27
  # @param opts [Hash]
21
28
  # @option opts [Nokogiri::XML::Builder] :builder XML builder
22
29
  # @option opts [Boolean] :bibdata
@@ -27,8 +27,7 @@ module RelatonIetf
27
27
  # @param hash [Hash]
28
28
  # @return [RelatonIetf::IetfBibliographicItem]
29
29
  def hash_to_bib(hash)
30
- item_hash = ::RelatonIetf::HashConverter.hash_to_bib(hash)
31
- ::RelatonIetf::IetfBibliographicItem.new item_hash
30
+ ::RelatonIetf::IetfBibliographicItem.from_hash hash
32
31
  end
33
32
 
34
33
  # Returns hash of XML grammar
@@ -1,3 +1,3 @@
1
1
  module RelatonIetf
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-ietf
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