lib/hydra/permissions_cache.rb in hydra-access-controls-6.0.0.rc2 vs lib/hydra/permissions_cache.rb in hydra-access-controls-6.0.0.rc3
- old
+ new
@@ -1,16 +1,18 @@
-module Hydra::PermissionsCache
- @@cache = {}
+class Hydra::PermissionsCache
+ def initialize
+ clear
+ end
- def self.get(pid)
- @@cache[pid]
+ def get(pid)
+ @cache[pid]
end
- def self.put(pid, doc)
- @@cache[pid] = doc
+ def put(pid, doc)
+ @cache[pid] = doc
end
- def self.clear
- @@cache = {}
+ def clear
+ @cache = {}
end
end