class Dragonfly::FileDataStore::MetaStore

Public Instance Methods

destroy(path) click to toggle source
# File lib/dragonfly/file_data_store.rb, line 25
def destroy(path)
  FileUtils.rm_f meta_path(path)
end
read(data_path) click to toggle source
# File lib/dragonfly/file_data_store.rb, line 20
def read(data_path)
  path = meta_path(data_path)
  File.open(path,'rb'){|f| load(f.read) } if File.exist?(path)
end
write(data_path, meta) click to toggle source
# File lib/dragonfly/file_data_store.rb, line 14
def write(data_path, meta)
  File.open(meta_path(data_path), 'wb') do |f|
    f.write dump(meta)
  end
end

Private Instance Methods

dump(meta) click to toggle source
# File lib/dragonfly/file_data_store.rb, line 35
def dump(meta)
  raise NotImplementedError
end
load(string) click to toggle source
# File lib/dragonfly/file_data_store.rb, line 39
def load(string)
  raise NotImplementedError
end
meta_path(data_path) click to toggle source
# File lib/dragonfly/file_data_store.rb, line 31
def meta_path(data_path)
  raise NotImplementedError
end