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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 598c63cdf96e8fa4d5abbdf60d08c1014dbbea28343cfc1b91ce6c185496a216
4
- data.tar.gz: 20a9ebe8e8a72762dca37f501b655c3d38774b5a408eafc63954db71056362b2
3
+ metadata.gz: 2a232b33a8293be27f9fac20557b959345339a8835faa56cf31cbf75df849ac3
4
+ data.tar.gz: b8baf017786cd822b711816e2e015c7b5b5e4e63bd01b6b34d81eb4806974932
5
5
  SHA512:
6
- metadata.gz: 4498aefcfbd0d89998b38c3067ce7a2887d553645128df21dc6810dbaa6cb94e71ee392e11bc1657af0f043ea748a87b4c78f82cd60c2c867fec36d29572d108
7
- data.tar.gz: d6c90eeb56c15cfedc4a96bd6fa07e7a1148bf226fd71e2e89443f97634b17c0fe20d21e786c224d065d0c9a5da4f71e732c9721aa84ff92f0e5c01804e7545a
6
+ metadata.gz: 432adaba8dea3489f330e15d1e58a28c1843b936a944d6d86d5602401ccaf82f840f9646e64e6eecd88eb8ab289f23b30df68b244406da5227eff7aaa9fa1afe
7
+ data.tar.gz: 7579e6eecf194ec07063a6e6e13b79edec56a9baaba0c066d1e3aa84abb58126560cc48a861401acb4ae8f518bf442f60bfe484c00e6fc4fbbc5fa8931a82a1a
@@ -111,8 +111,7 @@ GEM
111
111
  PLATFORMS
112
112
  ruby
113
113
 
114
- DEPENDENCIES
115
- bundler (~> 2.0)
114
+ bundler (>= 2.0.1, < 3)
116
115
  debase
117
116
  rake (~> 10.0)
118
117
  rspec (~> 3.0)
@@ -2,7 +2,7 @@ module Tc211::Termbase
2
2
 
3
3
  class Term
4
4
 
5
- ATTRIBS = %i(
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
- attr_accessor *ATTRIBS
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
- ATTRIBS.inject({}) do |acc, attrib|
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
@@ -1,5 +1,5 @@
1
1
  module Tc211
2
2
  module Termbase
3
- VERSION = "0.1.13"
3
+ VERSION = "0.2.1"
4
4
  end
5
5
  end
@@ -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", "~> 2.0"
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.13
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-12 00:00:00.000000000 Z
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: '2.0'
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: '2.0'
60
+ version: '3'
55
61
  - !ruby/object:Gem::Dependency
56
62
  name: debase
57
63
  requirement: !ruby/object:Gem::Requirement