Hi!
I have a question about "exist" method.
Why is this function's return exception not ture/false?
For example, in branching processing juding from whether key exists or not,
we must use exception.
cache = Memcached.new("localhost:11211")
begin
cache.exist("my_key")
key_exist = true
rescue Memcached::NotFound => e
key_exist = false
end
if key_exist?
...
else
...
end
But, I think we should write following way.
cache = Memcached.new("localhost:11211")
if cache.exist("my_key")?
...
else
...
end
Hi! I have a question about "exist" method. Why is this function's return exception not ture/false?
For example, in branching processing juding from whether key exists or not, we must use exception.
But, I think we should write following way.