Class: Geocoder::CacheStore::Base
- Inherits:
-
Object
- Object
- Geocoder::CacheStore::Base
- Defined in:
- lib/geocoder/cache_stores/base.rb
Instance Method Summary collapse
-
#initialize(store, options) ⇒ Base
constructor
A new instance of Base.
-
#keys ⇒ Object
Array of keys with the currently configured prefix that have non-nil values.
-
#urls ⇒ Object
Array of cached URLs.
Constructor Details
#initialize(store, options) ⇒ Base
Returns a new instance of Base.
3 4 5 6 7 |
# File 'lib/geocoder/cache_stores/base.rb', line 3 def initialize(store, ) @store = store @config = @prefix = config[:prefix] end |
Instance Method Details
#keys ⇒ Object
Array of keys with the currently configured prefix that have non-nil values.
12 13 14 |
# File 'lib/geocoder/cache_stores/base.rb', line 12 def keys store.keys.select { |k| k.match(/^#{prefix}/) and self[k] } end |
#urls ⇒ Object
Array of cached URLs.
19 20 21 |
# File 'lib/geocoder/cache_stores/base.rb', line 19 def urls keys end |