Files
danbooru/app/logical/storage_manager/hybrid.rb
2018-04-07 21:06:38 -05:00

24 lines
640 B
Ruby

class StorageManager::Hybrid < StorageManager
attr_reader :submanager
def initialize(&block)
@submanager = block
end
def store_file(io, post, type)
submanager[post.id, post.md5, post.file_ext, type].store_file(io, post, type)
end
def delete_file(post_id, md5, file_ext, type)
submanager[post_id, md5, file_ext, type].delete_file(post_id, md5, file_ext, type)
end
def open_file(post, type)
submanager[post.id, post.md5, post.file_ext, type].open_file(post, type)
end
def file_url(post, type, **options)
submanager[post.id, post.md5, post.file_ext, type].file_url(post, type, **options)
end
end