lru_redux
lru_redux copied to clipboard
LruRedux::TTL::ThreadSafeCache.delete does not return the deleted item as docs say
The LruRedux::TTL::ThreadSafeCache.delete
method does not return the deleted item as docs say. It looks like the code returns an expiration time float value and not the deleted item.
Easy enough to work around, but we need to either update the README docs or change the library's behavior.
Example reproduction:
my_cache = LruRedux::TTL::ThreadSafeCache.new(8, 300)
my_cache["a"] = "This is string A"
my_cache["b"] = "This is string B"
result_obj = my_cache.delete "a"
puts "result_obj: #{result_obj} #{result_obj.class}"
This produces output like:
result_obj: 1697043228.1882849 Float