# File src/LRUCache.rb, line 40
                def []=(key, val)
                        if @queue.length == @max
                                d = @queue.shift
                                @cache.delete d
                                @ttl_cache.delete d
                        end
                        if @queue.first and @maxttl
                                now = Time.now.to_i
                                while ((@ttl_cache[@queue.first].to_i + @maxttl) < now)
                                        d = @queue.shift
                                        do_finalization(d,@cache[d])
                                        @cache.delete d
                                        @ttl_cache.delete d
                                end
                        end
                        @cache[key] = val
                        @ttl_cache[key] = Time.now.to_i
                        @queue.push key
                end