locabulary 0.1.2 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c4932eaa5517bde9397ca5860f3b48d4b7101f5c
4
- data.tar.gz: aea1138601a18b97820bda90be74b07a46b3a6d2
3
+ metadata.gz: eaa6a939234e76a255e7801f1566e65e8fd33245
4
+ data.tar.gz: d46e978a63f45e8364027ecbaf36ecb1d51db631
5
5
  SHA512:
6
- metadata.gz: 668eed53daeffaa1a520b8a5c4ee0d44b719176b50cab25196ce1980ce25db1ec494564d87cca542add4e6ae07883ff4831d99a77ef599c2e0edde869e63abff
7
- data.tar.gz: af0ee98fc918114600497bcc795b795b07d7d2f751dec080bf46722ffcbb64c267a5d646bf874d0a435f4d7efd053e7dcdc9f8591c59a615241844e8f8de3c3e
6
+ metadata.gz: b67d12549e18ca3dd7c931d22adc21847dcf1cb7efc71c323807991502db0967c6bc7c9a359a4e971b2b18ff2aecbf76079ce34ad725ebef62b433188ec6bb95
7
+ data.tar.gz: 25fa2669c8195102b93a1922c3c36cb3c43befcaffd95ab0e783d744e1f020414bd66b2a8a76476ea807508c214fae78a295a005d00abb1eafe88f35e86c5a25
@@ -57,7 +57,7 @@
57
57
  },
58
58
  {
59
59
  "predicate_name": "program_name",
60
- "term_label": "Chemistry",
60
+ "term_label": "Chemistry and Biochemistry",
61
61
  "term_uri": null,
62
62
  "default_presentation_sequence": null,
63
63
  "activated_on": "2015-01-01",
@@ -151,14 +151,6 @@
151
151
  "activated_on": "2015-01-01",
152
152
  "deactivated_on": null
153
153
  },
154
- {
155
- "predicate_name": "program_name",
156
- "term_label": "Law",
157
- "term_uri": null,
158
- "default_presentation_sequence": null,
159
- "activated_on": "2015-01-01",
160
- "deactivated_on": null
161
- },
162
154
  {
163
155
  "predicate_name": "program_name",
164
156
  "term_label": "Literature",
@@ -255,4 +247,4 @@
255
247
  "activated_on": "2015-01-01",
256
248
  "deactivated_on": null
257
249
  }
258
- ]
250
+ ]
@@ -21,7 +21,7 @@
21
21
  "term_uri": null,
22
22
  "default_presentation_sequence": 3,
23
23
  "activated_on": "2015-01-01",
24
- "deactivated_on": "2015-07-07"
24
+ "deactivated_on": "2015-07-06"
25
25
  },
26
26
  {
27
27
  "predicate_name": "work_patent_strategy",
@@ -29,22 +29,22 @@
29
29
  "term_uri": null,
30
30
  "default_presentation_sequence": 4,
31
31
  "activated_on": "2015-01-01",
32
- "deactivated_on": "2015-07-07"
32
+ "deactivated_on": "2015-07-06"
33
33
  },
34
34
  {
35
35
  "predicate_name": "work_patent_strategy",
36
36
  "term_label": "non_provisional_patent_filed",
37
37
  "term_uri": null,
38
38
  "default_presentation_sequence": 5,
39
- "activated_on": "2015-07-07",
39
+ "activated_on": "2015-07-06",
40
40
  "deactivated_on": null
41
41
  },
42
42
  {
43
43
  "predicate_name": "work_patent_strategy",
44
- "term_label": "material already published",
44
+ "term_label": "material_already_published",
45
45
  "term_uri": null,
46
46
  "default_presentation_sequence": 6,
47
- "activated_on": "2015-07-07",
47
+ "activated_on": "2015-07-06",
48
48
  "deactivated_on": null
49
49
  }
50
50
  ]
data/lib/locabulary.rb CHANGED
@@ -3,7 +3,7 @@ require 'json'
3
3
 
4
4
  # @since 0.1.0
5
5
  module Locabulary
6
- VERSION='0.1.2'.freeze
6
+ VERSION='0.1.3'.freeze
7
7
  DATA_DIRECTORY = File.expand_path("../../data/", __FILE__).freeze
8
8
 
9
9
  class RuntimeError < ::RuntimeError
@@ -13,7 +13,7 @@ module Locabulary
13
13
  include Comparable
14
14
  ATTRIBUTE_NAMES = [:predicate_name, :term_label, :term_uri, :default_presentation_sequence, :activated_on, :deactivated_on].freeze
15
15
 
16
- attr_reader *ATTRIBUTE_NAMES
16
+ attr_reader(*ATTRIBUTE_NAMES)
17
17
 
18
18
  def initialize(attributes = {})
19
19
  ATTRIBUTE_NAMES.each do |key|
@@ -22,15 +22,20 @@ module Locabulary
22
22
  end
23
23
  end
24
24
 
25
+ SORT_SEQUENCE_FOR_NIL = 100_000_000
25
26
  def <=>(other)
26
- value = default_presentation_sequence <=> other.default_presentation_sequence
27
+ value = presentation_sequence <=> other.presentation_sequence
27
28
  return value unless value == 0
28
29
  term_label <=> other.term_label
29
30
  end
30
31
 
32
+ def presentation_sequence
33
+ default_presentation_sequence || SORT_SEQUENCE_FOR_NIL
34
+ end
35
+
31
36
  private
32
37
 
33
- attr_writer *ATTRIBUTE_NAMES
38
+ attr_writer(*ATTRIBUTE_NAMES)
34
39
  end
35
40
 
36
41
  module_function
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: locabulary
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeremy Friesen
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-07-07 00:00:00.000000000 Z
11
+ date: 2015-07-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler