dmtd_vbmapp_data 1.0.3 → 1.0.4
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 +4 -4
- data/CHANGELOG.md +9 -1
- data/lib/dmtd_vbmapp_data/guide.rb +21 -4
- data/lib/dmtd_vbmapp_data/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7ff92a3ffefd26edba360ec5d1124fe9ad42509d
|
4
|
+
data.tar.gz: b282d4a1a768fc22f3425335c07c8b36b5758f6e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f0b1b76b66fff0f900e4aeecd7123133575a68805c5ac91eb9feef7ef9d2eb6d4a530516b641ff2a0b66824e79237dd89e4fe2e79ac0b4a81e9853aacdd67295
|
7
|
+
data.tar.gz: 3a4e745d5dac38f95c578924d1a772b176cd8b476c62701bdc19010c23f4f02ada40b11575001f40bcf97893c1b4b3ed22a6d4f94760bac124f9ba6262c9145a
|
data/CHANGELOG.md
CHANGED
@@ -8,4 +8,12 @@
|
|
8
8
|
|
9
9
|
## 1.0.2
|
10
10
|
|
11
|
-
* Added an AssessmentReport class that simplifies the functionality of generating an IEP report
|
11
|
+
* Added an AssessmentReport class that simplifies the functionality of generating an IEP report
|
12
|
+
|
13
|
+
## 1.0.3
|
14
|
+
|
15
|
+
* Added language support
|
16
|
+
|
17
|
+
## 1.0.4
|
18
|
+
|
19
|
+
* Implemented the Guide's caching support
|
@@ -19,20 +19,28 @@ module DmtdVbmappData
|
|
19
19
|
|
20
20
|
# Populates the internal VB-MAPP guide index
|
21
21
|
#
|
22
|
-
# This index is cached locally and expires once a day.
|
22
|
+
# This index is cached locally and expires once a day at midnight UTC.
|
23
23
|
#
|
24
24
|
# The first call to this method with an expired cache will
|
25
25
|
# block until the cache is populated. All subsequent calls
|
26
26
|
# will load from the cache.
|
27
27
|
#
|
28
|
+
# NOTE: The cache is an in-memory cache (not on-disc). Thus, if the process is restarted,
|
29
|
+
# the cache will be dropped.
|
30
|
+
#
|
28
31
|
# Returns:
|
29
32
|
# Array as defined as the result of the 1/guide/index REST api
|
30
33
|
def index
|
31
|
-
|
32
|
-
|
34
|
+
|
35
|
+
expire_cache
|
36
|
+
if defined?(@@guide_cache).nil?
|
37
|
+
@@guide_cache = {
|
38
|
+
datestamp: DateTime.now.new_offset(0).to_date,
|
39
|
+
guide_index: retrieve_guide_index
|
40
|
+
}
|
33
41
|
end
|
34
42
|
|
35
|
-
|
43
|
+
@@guide_cache[:guide_index]
|
36
44
|
end
|
37
45
|
|
38
46
|
# Returns the VB-MAPP Guide chapters
|
@@ -49,6 +57,15 @@ module DmtdVbmappData
|
|
49
57
|
|
50
58
|
private
|
51
59
|
|
60
|
+
def expire_cache
|
61
|
+
if defined?(@@guide_cache)
|
62
|
+
today = DateTime.now.new_offset(0).to_date
|
63
|
+
cache_day = @@guide_cache[:datestamp]
|
64
|
+
|
65
|
+
@@guide_cache = nil unless cache_day == today
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
52
69
|
def self.end_point
|
53
70
|
'1/guide/index'
|
54
71
|
end
|