Module: ActiveSupport::Cache::Concerns::SaneMemcachedTtlHelper
- Extended by:
- ActiveSupport::Concern
- Includes:
- SaneMemcachedTtl::Utils
- Included in:
- ActiveSupport::Cache::CouchbaseStoreWithSaneTtl, DalliStoreWithSaneTtl, MemCacheStoreWithSaneTtl
- Defined in:
- lib/active_support/cache/concerns/sane_memcached_ttl_helper.rb
Constant Summary
Constants included from SaneMemcachedTtl::Utils
SaneMemcachedTtl::Utils::MEMCACHED_MAX_TTL
Instance Method Summary collapse
- #extract_large_default_ttl!(options, insane_options) ⇒ Object
- #sanitize_ttl_options!(options, insane_options, default_option) ⇒ Object
Methods included from SaneMemcachedTtl::Utils
#is_large_ttl?, #sanitize_ttl, #ttl_to_timestamp
Instance Method Details
#extract_large_default_ttl!(options, insane_options) ⇒ Object
14 15 16 17 18 19 20 21 |
# File 'lib/active_support/cache/concerns/sane_memcached_ttl_helper.rb', line 14 def extract_large_default_ttl!(, ) ttl = [.find { |option| [option] != nil }] if ttl.present? && is_large_ttl?(ttl) .each { |option| .delete option } self.large_default_ttl = ttl end end |
#sanitize_ttl_options!(options, insane_options, default_option) ⇒ Object
23 24 25 26 27 28 |
# File 'lib/active_support/cache/concerns/sane_memcached_ttl_helper.rb', line 23 def (, , default_option) ttl = [.find { |option| [option] != nil }] .each { |option| .delete(option) } [default_option] = sanitize_ttl(ttl || large_default_ttl) end |