relaton-ogc 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: 6c1bea6030f6216485604379c2499fcce4da67668408a673015de3bec47d5d5e
4
- data.tar.gz: 90d992c0215b7358f74c8a8b11da924452290d979b26e20a5bf4ae8d2d1fd4c9
3
+ metadata.gz: a2ac7a32c84f53dd1feca6fd3f78e6a747301ca8a5ea5acc6064aba28d35c4cc
4
+ data.tar.gz: 53f69c6c7ed7cde4cede3e94b6719e89db9d5d26e5515738b893015c65cf268f
5
5
  SHA512:
6
- metadata.gz: be1a6eb907bedda427214fe5f71d817f5a156e2b19edd99aa6733503ec72a653cb95f2acf3b4d6eab12d44d19b8e1a68d6030466ccec8411625bf9cc8c6a7cc9
7
- data.tar.gz: 83d6c5fa7dacb4c926222e1e78b90da5ac18a4b8dcd617013b79d74e58334d2b25a6f0382286b32b032ab3e8d1b5dcfec480dd174de35db57f0353a59c6a1041
6
+ metadata.gz: 870708b7b62d068fa1a712e0bd611d0ddcbcf047bc6be75961b643c74379867bcdf491c8b6ade8016dd2fb97f21a288924d8023c7ae5c1f69b0dba2a3688d01f
7
+ data.tar.gz: '058275c555a698afc60bb826a58bd6ffd0e03aa15785439dc80ae7dbcd7e360dfad9b0b9df6a4e9e3d5da180ce36debd06fba1a906d5fe4bb28390b77f542eaa'
data/README.adoc CHANGED
@@ -108,11 +108,7 @@ hash = YAML.load_file 'spec/fixtures/ogc_bib_item.yml'
108
108
  => {"id"=>"19-025r1",
109
109
  ...
110
110
 
111
- bib_hash = RelatonOgc::HashConverter.hash_to_bib hash
112
- => {:id=>"19-025r1",
113
- ...
114
-
115
- RelatonOgc::OgcBibliographicItem.new bib_hash
111
+ RelatonOgc::OgcBibliographicItem.from_hash hash
116
112
  => #<RelatonOgc::OgcBibliographicItem:0x007fc322ef8548
117
113
  ...
118
114
  ----
@@ -29,6 +29,13 @@ module RelatonOgc
29
29
  super
30
30
  end
31
31
 
32
+ # @param hash [Hash]
33
+ # @return [RelatonOgc::OgcBibliographicItem]
34
+ def self.from_hash(hash)
35
+ item_hash = ::RelatonOgc::HashConverter.hash_to_bib(hash)
36
+ new **item_hash
37
+ end
38
+
32
39
  # @return [Hash]
33
40
  def to_hash
34
41
  hash = super
@@ -26,8 +26,7 @@ module RelatonOgc
26
26
  # @param hash [Hash]
27
27
  # @return [RelatonOgc::OgcBibliographicItem]
28
28
  def hash_to_bib(hash)
29
- item_hash = ::RelatonOgc::HashConverter.hash_to_bib(hash)
30
- ::RelatonOgc::OgcBibliographicItem.new item_hash
29
+ ::RelatonOgc::OgcBibliographicItem.from_hash hash
31
30
  end
32
31
 
33
32
  # Returns hash of XML grammar
@@ -1,3 +1,3 @@
1
1
  module RelatonOgc
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-ogc
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