Class: GameFaqs::Caching::Cache

Inherits:
Object
  • Object
show all
Defined in:
lib/gamefaqs/caching.rb

Constant Summary collapse

STORE =
Store.new
@@max_size =
100

Class Method Summary collapse

Class Method Details

.[](key) ⇒ Object Also known as: fetch



41
42
43
# File 'lib/gamefaqs/caching.rb', line 41

def [](key)
  STORE[key]
end

.[]=(key, value) ⇒ Object



46
47
48
# File 'lib/gamefaqs/caching.rb', line 46

def []=(key, value)
  STORE[key] = value
end

.each(*args, &blk) ⇒ Object



54
55
56
# File 'lib/gamefaqs/caching.rb', line 54

def each(*args, &blk)
  STORE.each(*args, &blk)
end

.max_sizeObject



37
38
39
# File 'lib/gamefaqs/caching.rb', line 37

def max_size
  @@max_size
end

.max_size=(size) ⇒ Object



33
34
35
# File 'lib/gamefaqs/caching.rb', line 33

def max_size=(size)
  @@max_size = size
end

.sizeObject



50
51
52
# File 'lib/gamefaqs/caching.rb', line 50

def size
  STORE.size
end