class RemoteFiles::AbstractStore
Attributes
identifier[R]
Public Class Methods
new(identifier)
click to toggle source
# File lib/remote_files/abstract_store.rb, line 5 def initialize(identifier) @identifier = identifier end
Public Instance Methods
[]=(name, value)
click to toggle source
# File lib/remote_files/abstract_store.rb, line 13 def []=(name, value) options[name] = value end
copy_to_store!(file, target_store)
click to toggle source
# File lib/remote_files/abstract_store.rb, line 29 def copy_to_store!(file, target_store) raise "You need to implement #{self.class.name} #copy_to_store!" end
delete!(identifier)
click to toggle source
# File lib/remote_files/abstract_store.rb, line 41 def delete!(identifier) raise "You need to implement #{self.class.name}#delete!" end
directory_name()
click to toggle source
# File lib/remote_files/abstract_store.rb, line 21 def directory_name raise "You need to implement #{self.class.name}:#directory_name" end
file_from_url(url, options = {})
click to toggle source
# File lib/remote_files/abstract_store.rb, line 57 def file_from_url(url, options = {}) matched = url_matcher.match(url) return nil unless matched file_identifier = CGI.unescape(matched[1]) RemoteFiles::File.new(file_identifier, options.merge(:stored_in => [self])) end
files(prefix = '')
click to toggle source
# File lib/remote_files/abstract_store.rb, line 25 def files(prefix = '') raise "You need to implement #{self.class.name} #files" end
options()
click to toggle source
# File lib/remote_files/abstract_store.rb, line 9 def options @options ||= {} end
read_only?()
click to toggle source
# File lib/remote_files/abstract_store.rb, line 53 def read_only? options[:read_only] == true end
retrieve!(identifier)
click to toggle source
# File lib/remote_files/abstract_store.rb, line 37 def retrieve!(identifier) raise "You need to implement #{self.class.name}#retrieve!" end
store!(file)
click to toggle source
# File lib/remote_files/abstract_store.rb, line 33 def store!(file) raise "You need to implement #{self.class.name}#store!" end
to_sym()
click to toggle source
# File lib/remote_files/abstract_store.rb, line 17 def to_sym @identifier.to_sym end
url(identifier)
click to toggle source
# File lib/remote_files/abstract_store.rb, line 45 def url(identifier) raise "You need to implement #{self.class.name}#url" end
url_matcher()
click to toggle source
# File lib/remote_files/abstract_store.rb, line 49 def url_matcher raise "You need to implement #{self.class.name}:#url_matcher" end