Module: Rack::Cache::MonetaResolver Private

Includes:
Utils
Included in:
EntityStore::Moneta, Rack::Cache::MetaStore::Moneta
Defined in:
lib/rack/cache/moneta.rb

This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.

Instance Method Summary collapse

Instance Method Details

#resolve(uri) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/rack/cache/moneta.rb', line 15

def resolve(uri)
  cache = Rack::Cache::Moneta[uri.to_s.sub(%r{^moneta://}, '')] ||=
            begin
              options = parse_query(uri.query)
              options.keys.each do |key|
                options[key.to_sym] =
                  case value = options.delete(key)
                  when 'true'
                    true
                  when 'false'
                    false
                  else
                    value
                  end
              end
              ::Moneta.new(uri.host.to_sym, options)
            end
  new(cache)
end