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 +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/booking_locations/version.rb +1 -1
- data/lib/booking_locations.rb +3 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 79b422f442a9e926c075a1399e6095a21e10ca62
|
4
|
+
data.tar.gz: 54f5b1aef44c03f2b26b7056c60410ddc26e8e57
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 837e86259ea716276ae2db9d10d1ed92bbf77645903dda0fafd43c24c50ba989e2f8461f5d0d8c480f5532518e4aae05fa1272811c9226a0153f894e0a3cf6a4
|
7
|
+
data.tar.gz: 2ead219d3d1fd24cc8c9da99d0d84cff5601a1de5d5c37246ac34c904cac2b0097cf3e08259957c27a7b9d0349f4c591ecfb12a92f9f1b8f9bf0a98fb596edbd
|
data/CHANGELOG.md
CHANGED
data/lib/booking_locations.rb
CHANGED
@@ -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.
|
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-
|
11
|
+
date: 2017-03-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|