module SaneMemcachedTtl::Utils
Constants
- MEMCACHED_MAX_TTL
Public Instance Methods
is_large_ttl?(ttl)
click to toggle source
# File lib/sane_memcached_ttl/utils.rb, line 9 def is_large_ttl?(ttl) ttl.to_i > MEMCACHED_MAX_TTL end
sanitize_ttl(ttl)
click to toggle source
# File lib/sane_memcached_ttl/utils.rb, line 5 def sanitize_ttl(ttl) is_large_ttl?(ttl) ? ttl_to_timestamp(ttl) : ttl end
ttl_to_timestamp(ttl)
click to toggle source
# File lib/sane_memcached_ttl/utils.rb, line 13 def ttl_to_timestamp(ttl) Time.now.utc.to_i + ttl.to_i end