relaton-nist 0.3.2 → 0.3.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +2 -2
- data/lib/relaton_nist/comment_period.rb +8 -0
- data/lib/relaton_nist/keyword.rb +7 -0
- data/lib/relaton_nist/nist_bibliographic_item.rb +10 -2
- data/lib/relaton_nist/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: faceada8e94976b665bdb8599df2fc9889412bd9
|
4
|
+
data.tar.gz: e75e31cb091a6f1f9bfdb06ce801861a7f2f435c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bddc62ce9bd2499c1fd88db7a1bb6457fdaa4e754165756cab7b019ba85106b3e5ff7bb51e11650416a7aa59f891fe6a5d73bde4de966e68d879db3e1d4b0beb
|
7
|
+
data.tar.gz: 9bafb3ad3192317101ce3b6ee0b8b5a463f82c5d3b4d8727a94d835bb3fb8db287acb04cbc42ed2ad6f4eebe77f896d12d04278fe9049efd35ae752c24202171
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
relaton-nist (0.3.
|
4
|
+
relaton-nist (0.3.3)
|
5
5
|
relaton-bib (~> 0.3.0)
|
6
6
|
rubyzip
|
7
7
|
|
@@ -35,7 +35,7 @@ GEM
|
|
35
35
|
pry (~> 0.10)
|
36
36
|
public_suffix (3.1.1)
|
37
37
|
rake (10.5.0)
|
38
|
-
relaton-bib (0.3.
|
38
|
+
relaton-bib (0.3.5)
|
39
39
|
addressable
|
40
40
|
nokogiri (~> 1.10)
|
41
41
|
rspec (3.8.0)
|
@@ -26,5 +26,13 @@ module RelatonNist
|
|
26
26
|
builder.extended extended.to_s if extended
|
27
27
|
end
|
28
28
|
end
|
29
|
+
|
30
|
+
# @return [Hash]
|
31
|
+
def to_hash
|
32
|
+
hash = { "from" => from.to_s }
|
33
|
+
hash["to"] = to.to_s if to
|
34
|
+
hash["extended"] = extended.to_s if extended
|
35
|
+
hash
|
36
|
+
end
|
29
37
|
end
|
30
38
|
end
|
data/lib/relaton_nist/keyword.rb
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
module RelatonNist
|
2
2
|
class Keyword
|
3
|
+
include RelatonBib
|
4
|
+
|
3
5
|
# @return [Nokogiri::XML::DocumentFragment]
|
4
6
|
attr_reader :element
|
5
7
|
|
@@ -12,5 +14,10 @@ module RelatonNist
|
|
12
14
|
def to_xml(builder)
|
13
15
|
builder.keyword element.to_xml
|
14
16
|
end
|
17
|
+
|
18
|
+
# @return [String]
|
19
|
+
def to_hash
|
20
|
+
element.text
|
21
|
+
end
|
15
22
|
end
|
16
23
|
end
|
@@ -6,7 +6,7 @@ module RelatonNist
|
|
6
6
|
# @return [Array<RelatonNist::Keyword>]
|
7
7
|
attr_reader :keyword
|
8
8
|
|
9
|
-
# @return [RelatonNist::CommentPeriod]
|
9
|
+
# @return [RelatonNist::CommentPeriod, NilClass]
|
10
10
|
attr_reader :commentperiod
|
11
11
|
|
12
12
|
# @param id [String, NilClass]
|
@@ -31,7 +31,7 @@ module RelatonNist
|
|
31
31
|
# @param fetched [Date, NilClass] default nil
|
32
32
|
# @param doctype [String]
|
33
33
|
# @param keyword [Array<RelatonNist::Keyword>]
|
34
|
-
# @param commentperiod [RelatonNist::CommentPeriod]
|
34
|
+
# @param commentperiod [RelatonNist::CommentPeriod, NilClass]
|
35
35
|
#
|
36
36
|
# @param date [Array<Hash>]
|
37
37
|
# @option date [String] :type
|
@@ -74,5 +74,13 @@ module RelatonNist
|
|
74
74
|
end
|
75
75
|
end
|
76
76
|
end
|
77
|
+
|
78
|
+
# @return [Hash]
|
79
|
+
def to_hash
|
80
|
+
hash = super
|
81
|
+
hash["keyword"] = single_element_array(keyword) if keyword&.any?
|
82
|
+
hash["commentperiod"] = commentperiod.to_hash if commentperiod
|
83
|
+
hash
|
84
|
+
end
|
77
85
|
end
|
78
86
|
end
|
data/lib/relaton_nist/version.rb
CHANGED
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: 0.3.
|
4
|
+
version: 0.3.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-08-
|
11
|
+
date: 2019-08-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|