Module: Algorithmable::Cache::Methods

Defined in:
lib/algorithmable/cache/methods.rb

Instance Method Summary collapse

Instance Method Details

#clearObject


4
5
6
7
8
# File 'lib/algorithmable/cache/methods.rb', line 4

def clear
  @storage = {}
  @index = []
  self
end

#popObject


10
11
12
13
# File 'lib/algorithmable/cache/methods.rb', line 10

def pop
  key = @index.delete @index.last
  @storage.delete key
end