Module: Rublox::Cache
- Defined in:
- lib/rublox/util/cache.rb
Overview
Note:
Only use if you have an use case that the library doesn’t cover (and create an issue and perhaps we’ll implement it!).
Constant Summary collapse
- USER =
The key for the user cache.
:users
- GROUP =
The key for the group cache.
:groups
- PAGE =
The key for the page cache.
:pages
Class Method Summary collapse
-
.get(type, id) ⇒ FullUser, ...
Try to get an object from cache.
-
.set(type, id, object) ⇒ nil
Set an object in the cache, under the type’s key.
Class Method Details
.get(type, id) ⇒ FullUser, ...
Try to get an object from cache.
25 26 27 |
# File 'lib/rublox/util/cache.rb', line 25 def self.get(type, id) @cache[type][id] end |
.set(type, id, object) ⇒ nil
Set an object in the cache, under the type’s key.
35 36 37 |
# File 'lib/rublox/util/cache.rb', line 35 def self.set(type, id, object) @cache[type][id] = object end |