-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathabstract.rb
More file actions
30 lines (22 loc) · 860 Bytes
/
abstract.rb
File metadata and controls
30 lines (22 loc) · 860 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
module Grid
module EditorIntegration
module Storages
class AbstractStorage
attr_accessor :path, :cdn_url
def initialize(path = nil, cdn_url = "", options = {})
self.path = options[:prefix] ? ::File.join(options[:prefix], path) : path
self.cdn_url = cdn_url
end
def file_exists?(file_name) raise NotImplementedError; end
def path_exists?(path_name) raise NotImplementedError; end
def create_path() raise NotImplementedError; end
def save_content_in_file(content, file_name, options = {})
raise NotImplementedError
end
def file_url(file_name) "#{cdn_url}/#{path}/#{file_name}"; end
def get_content_by_file_name(file_name) raise NotImplementedError; end
def clear() raise NotImplementedError; end
end
end
end
end