module Paperclip::Storage::Aliyun

Public Class Methods

extended(base) click to toggle source
# File lib/paperclip/storage/aliyun.rb, line 4
def self.extended(base)
end

Public Instance Methods

copy_to_local_file(style = default_style, local_dest_path) click to toggle source
# File lib/paperclip/storage/aliyun.rb, line 29
def copy_to_local_file(style = default_style, local_dest_path)
  log("copying #{path(style)} to local file #{local_dest_path}")
  local_file = ::File.open(local_dest_path, 'wb')
  remote_file_str = oss_connection.get path(style)
  local_file.write(remote_file_str)
  local_file.close
end
exists?(style = default_style) click to toggle source
# File lib/paperclip/storage/aliyun.rb, line 7
def exists?(style = default_style)
  oss_connection.exists? path(style)
end
oss_connection() click to toggle source
# File lib/paperclip/storage/aliyun.rb, line 37
def oss_connection
  return @oss_connection if @oss_connection

  @oss_connection ||= ::Aliyun::Connection.new
end