Class: Hydra::PermissionsCache
- Inherits:
-
Object
- Object
- Hydra::PermissionsCache
- Defined in:
- lib/hydra/permissions_cache.rb
Instance Method Summary collapse
- #clear ⇒ Object
- #get(pid) ⇒ Object
-
#initialize ⇒ PermissionsCache
constructor
A new instance of PermissionsCache.
- #put(pid, doc) ⇒ Object
Constructor Details
#initialize ⇒ PermissionsCache
Returns a new instance of PermissionsCache.
2 3 4 |
# File 'lib/hydra/permissions_cache.rb', line 2 def initialize clear end |
Instance Method Details
#clear ⇒ Object
14 15 16 |
# File 'lib/hydra/permissions_cache.rb', line 14 def clear @cache = {} end |
#get(pid) ⇒ Object
6 7 8 |
# File 'lib/hydra/permissions_cache.rb', line 6 def get(pid) @cache[pid] end |
#put(pid, doc) ⇒ Object
10 11 12 |
# File 'lib/hydra/permissions_cache.rb', line 10 def put(pid, doc) @cache[pid] = doc end |