booking_locations 0.10.0 → 0.11.0

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
  SHA1:
3
- metadata.gz: 5f7ea1ca1b2145a56d5836d0b721e2dfac5d7f8b
4
- data.tar.gz: 59289e2f04cc95e9df12445f620fd67ab1435852
3
+ metadata.gz: 79b422f442a9e926c075a1399e6095a21e10ca62
4
+ data.tar.gz: 54f5b1aef44c03f2b26b7056c60410ddc26e8e57
5
5
  SHA512:
6
- metadata.gz: 9d6894c9994426e97a642f463284eeef6a2cccbab562ed622f6b7b372570691b110a5906a7b763ec3399d2fe7fe12b56f82373faf4ac0f9536a9db947e54d5da
7
- data.tar.gz: baa48ec0ae216ada01f208ce52b16c6cff999ae8de26de99f1bd77f9259c7ff83f0cc35f19d53d7d5d944b7fd18a1a9a0e24b928a85461a0bd645d914e83ac8e
6
+ metadata.gz: 837e86259ea716276ae2db9d10d1ed92bbf77645903dda0fafd43c24c50ba989e2f8461f5d0d8c480f5532518e4aae05fa1272811c9226a0153f894e0a3cf6a4
7
+ data.tar.gz: 2ead219d3d1fd24cc8c9da99d0d84cff5601a1de5d5c37246ac34c904cac2b0097cf3e08259957c27a7b9d0349f4c591ecfb12a92f9f1b8f9bf0a98fb596edbd
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## 0.11.0
2
+
3
+ * Add cache key namespacing / prefixing
4
+
1
5
  ## 0.10.0
2
6
 
3
7
  * Add `Location#hidden` flag and predicate
@@ -1,3 +1,3 @@
1
1
  module BookingLocations
2
- VERSION = '0.10.0'.freeze
2
+ VERSION = '0.11.0'.freeze
3
3
  end
@@ -7,6 +7,7 @@ require 'active_support/core_ext/module/attribute_accessors'
7
7
  require 'active_support/cache/null_store'
8
8
 
9
9
  module BookingLocations
10
+ DEFAULT_PREFIX = 'booking_locations:'
10
11
  DEFAULT_TTL = 2 * 60 * 60 # 2 hours
11
12
 
12
13
  mattr_writer :api
@@ -20,8 +21,8 @@ module BookingLocations
20
21
  @@cache ||= ActiveSupport::Cache::NullStore.new
21
22
  end
22
23
 
23
- def self.find(id, expires = DEFAULT_TTL)
24
- cache.fetch(id, expires_in: expires) do
24
+ def self.find(id, expires = DEFAULT_TTL, prefix = DEFAULT_PREFIX)
25
+ cache.fetch(prefix.concat(id), expires_in: expires) do
25
26
  api.get(id) do |response_hash|
26
27
  Location.new(response_hash)
27
28
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: booking_locations
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.0
4
+ version: 0.11.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben Lovell
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-03-09 00:00:00.000000000 Z
11
+ date: 2017-03-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport