Parent

Rack::Cache::AppEngine::MemCache

Public Class Methods

new(options = {}) click to toggle source
    # File lib/rack/cache/appengine.rb, line 18
18:       def initialize(options = {})
19:         @cache = MC::Service
20:         @cache.namespace = options[:namespace] if options[:namespace]
21:       end

Public Instance Methods

contains?(key) click to toggle source
    # File lib/rack/cache/appengine.rb, line 23
23:       def contains?(key)
24:         MC::Service.contains(key)
25:       end
delete(key) click to toggle source
    # File lib/rack/cache/appengine.rb, line 46
46:       def delete(key)
47:         MC::Service.delete(key)
48:       end
get(key) click to toggle source
    # File lib/rack/cache/appengine.rb, line 27
27:       def get(key)
28:         value = MC::Service.get(key)
29:         Marshal.load(Base64.decode64(value)) if value
30:       end
namespace() click to toggle source
    # File lib/rack/cache/appengine.rb, line 38
38:       def namespace
39:         MC::Service.getNamespace
40:       end
namespace=(value) click to toggle source
    # File lib/rack/cache/appengine.rb, line 42
42:       def namespace=(value)
43:         MC::Service.setNamespace(value.to_s)
44:       end
put(key, value, ttl = nil) click to toggle source
    # File lib/rack/cache/appengine.rb, line 32
32:       def put(key, value, ttl = nil)
33:         expiration = ttl ? MC::Expiration.byDeltaSeconds(ttl) : nil
34:         value = Base64.encode64(Marshal.dump(value)).gsub(/\n/, '')
35:         MC::Service.put(key, value, expiration)
36:       end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.