Sha256: 16eeaf0505c09f0f61b290d8eaf1566edb9256596cde3a9871a3b6715819a93e
Contents?: true
Size: 563 Bytes
Versions: 28
Compression:
Stored size: 563 Bytes
Contents
require 'friendly/storage' module Friendly class Cache < Storage class << self def cache_for(klass, fields, options) unless fields == [:id] raise NotSupported, "Caching is only possible by id at the moment." end ByID.new(klass, fields, options) end end attr_reader :klass, :fields, :cache, :version def initialize(klass, fields, options = {}, cache = Friendly.cache) @klass = klass @fields = fields @cache = cache @version = options[:version] || 0 end end end
Version data entries
28 entries across 28 versions & 7 rubygems