class Cloudinary::Cache::KeyValueCacheAdapter

Public Instance Methods

flush_all() click to toggle source
# File lib/cloudinary/cache/key_value_cache_adapter.rb, line 14
def flush_all()
  @storage.flush_all()
end
get(public_id, type, resource_type, transformation, format) click to toggle source
# File lib/cloudinary/cache/key_value_cache_adapter.rb, line 4
def get(public_id, type, resource_type, transformation, format)
  key = generate_cache_key(public_id, type, resource_type, transformation, format)
  @storage.get(key)
end
set(public_id, type, resource_type, transformation, format, value) click to toggle source
# File lib/cloudinary/cache/key_value_cache_adapter.rb, line 9
def set(public_id, type, resource_type, transformation, format, value)
  key = generate_cache_key(public_id, type, resource_type, transformation, format)
  @storage.set(key, value)
end

Private Instance Methods

generate_cache_key(public_id, type, resource_type, transformation, format) click to toggle source
# File lib/cloudinary/cache/key_value_cache_adapter.rb, line 20
def generate_cache_key(public_id, type, resource_type, transformation, format)
  Digest::SHA1.hexdigest [public_id, type, resource_type, transformation, format].reject(&:blank?)
end