class JSONFactory::Cache

Attributes

prefix[RW]
store[RW]

Public Class Methods

new() click to toggle source
# File lib/json_factory/cache.rb, line 8
def initialize
  @prefix = 'json_factory'
end

Public Instance Methods

fetch(key, options = nil, &block) click to toggle source
# File lib/json_factory/cache.rb, line 16
def fetch(key, options = nil, &block)
  store.fetch(transform_key(key), options, &block)
end
transform_key(key) click to toggle source
# File lib/json_factory/cache.rb, line 12
def transform_key(key)
  [prefix, key].compact.join(':')
end