class Cloudinary::Cache::BreakpointsCache

Attributes

adapter[RW]

Public Instance Methods

fetch(public_id, options) click to toggle source
# File lib/cloudinary/cache/breakpoints_cache.rb, line 11
def fetch(public_id, options)
  upload_type, resource_type, transformation, format = options_to_parameters(options)
  @adapter.set(public_id, upload_type, resource_type, transformation, format, &Proc.new)

end
get(public_id, options) click to toggle source
# File lib/cloudinary/cache/breakpoints_cache.rb, line 17
def get(public_id, options)
  upload_type, resource_type, transformation, format = options_to_parameters(options)
  @adapter.get(public_id, upload_type, resource_type, transformation, format)
end
options_to_parameters(options) click to toggle source
# File lib/cloudinary/cache/breakpoints_cache.rb, line 22
def options_to_parameters(options)
  options = Cloudinary::Utils.symbolize_keys options
  transformation = Cloudinary::Utils.generate_transformation_string(options)
  upload_type = options[:type] || 'upload'
  resource_type = options[:resource_type] || 'image'
  format = options[:format] || ""
  [upload_type, resource_type, transformation, format]
end
set(public_id, options, value) click to toggle source
# File lib/cloudinary/cache/breakpoints_cache.rb, line 5
def set(public_id, options, value)
  upload_type, resource_type, transformation, format = options_to_parameters(options)
  @adapter.set(public_id, upload_type, resource_type, transformation, format, value)

end