household_people_and_contributions 0.0.7 → 0.0.8

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: 9bc80286f4cc5fbd5c1b9f4806eb750bacf43860
4
- data.tar.gz: 79a09b7eeb66a2010d4a3b99a130998b9d8b5082
3
+ metadata.gz: 7b9671c3c6bcb0fd94db54cd9b0867332bc9239a
4
+ data.tar.gz: 351a66975be40f3dcdaa3c6155c72811f0832372
5
5
  SHA512:
6
- metadata.gz: b4cf55788bfe5e4e171249732dd9197c44434e4b4f6a917bba001d97830e52c4ad0639cf328069e73b8c2dcae7dbcf66abacaeabef5d743a397ca61b7d2b3f44
7
- data.tar.gz: 11cf7deed9f3d3d623b7ecd326dadba7f61efe47a5c2b00fe0cbeffd98da0bbb45fb6d02ccd0a2b90c7a772460612d5c8bd748a6287debcc3b122c01e602473d
6
+ metadata.gz: 9644bc684cffa9c9fac35867d1a3b148ae2e68977ac267c52bc9bf15b657fcce896c5c1219c4e07f3ce1ea9be7f7fa00ee467ab08d8cbc25e38534bb357a87d2
7
+ data.tar.gz: 8c9896258beda5ee96f11012d529dabeb35ab0df277f1027e5228de375c6aae569248cddf7e8a7b54949b1bd0697f4c3305ab94cb8ad7d1b67e5fe13957bbc4d
@@ -43,6 +43,10 @@ module HouseholdPeopleAndContributions
43
43
  ATTRIBUTED_SCHOLAR_RECORDS_PATH_FORMAT = "/v1/People/Search.json?id=%s&include=communications,attributes"
44
44
  CONTRIBUTION_RECORDS_PATH_TEMPLATE = "/giving/v1/contributionreceipts/search.json?householdID=%s&startReceivedDate=%s&endReceivedDate=%s"
45
45
 
46
+ def initialize(cache=true)
47
+ @cache = cache
48
+ end
49
+
46
50
  def key
47
51
  unless @key
48
52
  @key =
@@ -158,11 +162,13 @@ module HouseholdPeopleAndContributions
158
162
  cache_file = options[:prefix] + "_" + cache_file
159
163
  end
160
164
  cache_file = CACHE_DIR + "/" + cache_file
161
- if File.exists?(cache_file)
165
+ if @cache && File.exists?(cache_file)
162
166
  results_array = JSON.parse(File.read(cache_file))
163
167
  else
164
168
  results_array = get(records_path, options[:key])
165
- File.write(cache_file, results_array.to_json)
169
+ if @cache
170
+ File.write(cache_file, results_array.to_json)
171
+ end
166
172
  end
167
173
  return results_array
168
174
  end
@@ -1,3 +1,3 @@
1
1
  module HouseholdPeopleAndContributions
2
- VERSION = "0.0.7"
2
+ VERSION = "0.0.8"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: household_people_and_contributions
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jay Tee