Class: Vidocq::Cache
- Inherits:
-
Object
- Object
- Vidocq::Cache
- Defined in:
- lib/vidocq/cache.rb
Instance Method Summary collapse
- #endpoints ⇒ Object
-
#initialize(sid, version, opts = {}) ⇒ Cache
constructor
A new instance of Cache.
Constructor Details
#initialize(sid, version, opts = {}) ⇒ Cache
Returns a new instance of Cache.
6 7 8 9 10 11 |
# File 'lib/vidocq/cache.rb', line 6 def initialize(sid, version, opts = {}) @ttl = opts.fetch(:ttl, 0) @cs = opts.fetch(:zk, 'localhost:2181') @parent = "/companybook/services/#{sid}/#{version}" @endpoints = [] end |
Instance Method Details
#endpoints ⇒ Object
13 14 15 |
# File 'lib/vidocq/cache.rb', line 13 def endpoints outdated? ? expire! : @endpoints end |