1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/lib/active_file/site.rb

42 lines
780 B
Ruby
Raw Normal View History

2017-07-01 06:10:11 -04:00
# Abstract class serving as an interface for concrete sites.
class ActiveFile::Site
def self.configure(site, **options)
begin
require "active_file/site/#{site.to_s.downcase}_site"
ActiveFile::Site.const_get(:"#{site}Site").new(**options)
2017-07-04 11:29:30 -04:00
rescue LoadError
puts "Couldn't configure unknow site: #{site}"
end
end
def upload(key, io)
2017-07-01 06:10:11 -04:00
raise NotImplementedError
2017-06-30 13:12:58 -04:00
end
def download(key)
2017-07-01 06:10:11 -04:00
raise NotImplementedError
2017-06-30 13:12:58 -04:00
end
def delete(key)
2017-07-01 06:10:11 -04:00
raise NotImplementedError
2017-06-30 13:12:58 -04:00
end
2017-07-03 15:08:36 -04:00
def exist?(key)
2017-07-01 06:10:11 -04:00
raise NotImplementedError
2017-06-30 13:12:58 -04:00
end
def url(key, expires_in:, disposition:, filename:)
2017-07-01 06:10:11 -04:00
raise NotImplementedError
2017-06-30 13:12:58 -04:00
end
def bytesize(key)
2017-07-01 06:10:11 -04:00
raise NotImplementedError
2017-06-30 13:12:58 -04:00
end
def checksum(key)
2017-07-01 06:10:11 -04:00
raise NotImplementedError
2017-06-30 13:12:58 -04:00
end
2017-06-30 18:14:22 -04:00
end