module QiniuHelper

Public Instance Methods

delete(key) click to toggle source
# File lib/qiniu_rails/qiniu_helper.rb, line 28
def delete(key)
  code, result, response_headers = Qiniu::Storage.delete(
    bucket,
    key
  )
  code
end
download_url(key) click to toggle source
# File lib/qiniu_rails/qiniu_helper.rb, line 12
def download_url(key)
  Qiniu::Auth.authorize_download_url_2(host, key)
end
qiniu_url(key) click to toggle source
# File lib/qiniu_rails/qiniu_helper.rb, line 16
def qiniu_url(key)
  _host = host
  _host = host + '/' unless _host.end_with? '/'
  _host = 'http://' + _host unless _host.start_with? 'http://'
  _host + key.to_s
end
upload(local_file, key = nil, **options) click to toggle source
# File lib/qiniu_rails/qiniu_helper.rb, line 23
def upload(local_file, key = nil, **options)
  code, result, response_headers = upload_verbose(local_file, key, options)
  result['key']
end