Class: RubyRoutes::LruStrategies::HitStrategy

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby_routes/lru_strategies/hit_strategy.rb

Instance Method Summary collapse

Instance Method Details

#call(lru, key) ⇒ Object



4
5
6
7
8
9
10
# File 'lib/ruby_routes/lru_strategies/hit_strategy.rb', line 4

def call(lru, key)
  lru.increment_hits
  h = lru.instance_variable_get(:@h)
  val = h.delete(key)
  h[key] = val
  val
end