tc211-termbase 0.1.13 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -2
- data/lib/tc211/termbase/term.rb +24 -3
- data/lib/tc211/termbase/version.rb +1 -1
- data/tc211-termbase.gemspec +1 -1
- metadata +12 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2a232b33a8293be27f9fac20557b959345339a8835faa56cf31cbf75df849ac3
|
4
|
+
data.tar.gz: b8baf017786cd822b711816e2e015c7b5b5e4e63bd01b6b34d81eb4806974932
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 432adaba8dea3489f330e15d1e58a28c1843b936a944d6d86d5602401ccaf82f840f9646e64e6eecd88eb8ab289f23b30df68b244406da5227eff7aaa9fa1afe
|
7
|
+
data.tar.gz: 7579e6eecf194ec07063a6e6e13b79edec56a9baaba0c066d1e3aa84abb58126560cc48a861401acb4ae8f518bf442f60bfe484c00e6fc4fbbc5fa8931a82a1a
|
data/Gemfile.lock
CHANGED
data/lib/tc211/termbase/term.rb
CHANGED
@@ -2,7 +2,7 @@ module Tc211::Termbase
|
|
2
2
|
|
3
3
|
class Term
|
4
4
|
|
5
|
-
|
5
|
+
INPUT_ATTRIBS = %i(
|
6
6
|
id term abbrev synonyms alt definition
|
7
7
|
country_code
|
8
8
|
language_code
|
@@ -26,7 +26,9 @@ class Term
|
|
26
26
|
release
|
27
27
|
)
|
28
28
|
|
29
|
-
|
29
|
+
OUTPUT_ATTRIBS = INPUT_ATTRIBS - %i(term alt classification) + %i(terms)
|
30
|
+
|
31
|
+
attr_accessor *(INPUT_ATTRIBS | OUTPUT_ATTRIBS)
|
30
32
|
|
31
33
|
def initialize(options={})
|
32
34
|
@examples = []
|
@@ -146,7 +148,7 @@ class Term
|
|
146
148
|
end
|
147
149
|
|
148
150
|
def to_hash
|
149
|
-
|
151
|
+
OUTPUT_ATTRIBS.inject({}) do |acc, attrib|
|
150
152
|
value = self.send(attrib)
|
151
153
|
unless value.nil?
|
152
154
|
acc.merge(attrib.to_s => value)
|
@@ -240,6 +242,25 @@ class Term
|
|
240
242
|
release >= 0
|
241
243
|
end
|
242
244
|
|
245
|
+
def terms
|
246
|
+
[primary_term_hash, alt_term_hash].compact
|
247
|
+
end
|
248
|
+
|
249
|
+
def primary_term_hash
|
250
|
+
{
|
251
|
+
"type" => "expression",
|
252
|
+
"designation" => term,
|
253
|
+
"normative_status" => classification,
|
254
|
+
} if term
|
255
|
+
end
|
256
|
+
|
257
|
+
def alt_term_hash
|
258
|
+
{
|
259
|
+
"type" => "expression",
|
260
|
+
"designation" => alt,
|
261
|
+
"normative_status" => classification,
|
262
|
+
} if alt
|
263
|
+
end
|
243
264
|
end
|
244
265
|
|
245
266
|
end
|
data/tc211-termbase.gemspec
CHANGED
@@ -25,7 +25,7 @@ Gem::Specification.new do |spec|
|
|
25
25
|
spec.add_runtime_dependency "creek"
|
26
26
|
spec.add_runtime_dependency "relaton", "~> 1.0"
|
27
27
|
|
28
|
-
spec.add_development_dependency "bundler", "
|
28
|
+
spec.add_development_dependency "bundler", ">= 2.0.1", "< 3"
|
29
29
|
spec.add_development_dependency "debase"
|
30
30
|
spec.add_development_dependency "rake", "~> 10.0"
|
31
31
|
spec.add_development_dependency "rspec", "~> 3.0"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tc211-termbase
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-05-
|
11
|
+
date: 2020-05-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: creek
|
@@ -42,16 +42,22 @@ dependencies:
|
|
42
42
|
name: bundler
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- - "
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: 2.0.1
|
48
|
+
- - "<"
|
46
49
|
- !ruby/object:Gem::Version
|
47
|
-
version: '
|
50
|
+
version: '3'
|
48
51
|
type: :development
|
49
52
|
prerelease: false
|
50
53
|
version_requirements: !ruby/object:Gem::Requirement
|
51
54
|
requirements:
|
52
|
-
- - "
|
55
|
+
- - ">="
|
56
|
+
- !ruby/object:Gem::Version
|
57
|
+
version: 2.0.1
|
58
|
+
- - "<"
|
53
59
|
- !ruby/object:Gem::Version
|
54
|
-
version: '
|
60
|
+
version: '3'
|
55
61
|
- !ruby/object:Gem::Dependency
|
56
62
|
name: debase
|
57
63
|
requirement: !ruby/object:Gem::Requirement
|