LRU cache implementation in Ruby