Class: WithRateLimit::Cache::Memory

Inherits:
WithRateLimit::Cache show all
Defined in:
lib/with_rate_limit/cache/memory.rb

Class Method Summary collapse

Methods inherited from WithRateLimit::Cache

#get, #set

Class Method Details

.cacheObject



11
12
13
# File 'lib/with_rate_limit/cache/memory.rb', line 11

def self.cache
  @cache ||= {}
end

.get(key) ⇒ Object



7
8
9
# File 'lib/with_rate_limit/cache/memory.rb', line 7

def self.get(key)
  cache[key] || {}
end

.set(key, values) ⇒ Object



3
4
5
# File 'lib/with_rate_limit/cache/memory.rb', line 3

def self.set(key, values)
  cache[key] = values
end