class CarrierWave::Storage::IKFile
Public Class Methods
new(identifier)
click to toggle source
Initialize as required.
# File lib/carrierwave/storage/ik_file.rb, line 6 def initialize(identifier) @identifier=JSON.parse(identifier) ik_config=Rails.application.config.imagekit @imagekit=ImageKit::ImageKitClient.new(ik_config[:private_key],ik_config[:public_key],ik_config[:url_endpoint]) end
Public Instance Methods
content_type()
click to toggle source
Duck-type methods for CarrierWave::SanitizedFile.
# File lib/carrierwave/storage/ik_file.rb, line 13 def content_type "image/jpg" end
delete()
click to toggle source
# File lib/carrierwave/storage/ik_file.rb, line 33 def delete # file_id=@identifier['fileId'] begin @imagekit.delete_file(fileId) rescue fileId end # binding.pry # return nil end
exists?()
click to toggle source
# File lib/carrierwave/storage/ik_file.rb, line 43 def exists? end
fileId()
click to toggle source
# File lib/carrierwave/storage/ik_file.rb, line 23 def fileId @identifier['fileId'] end
filename(options = {})
click to toggle source
# File lib/carrierwave/storage/ik_file.rb, line 26 def filename(options = {}) @identifier['name'] end
public_url()
click to toggle source
# File lib/carrierwave/storage/ik_file.rb, line 16 def public_url @identifier['url'] end
read()
click to toggle source
# File lib/carrierwave/storage/ik_file.rb, line 29 def read end
size()
click to toggle source
# File lib/carrierwave/storage/ik_file.rb, line 31 def size end
url(options = {})
click to toggle source
# File lib/carrierwave/storage/ik_file.rb, line 19 def url(options = {}) @identifier['url'] end