Harbor Documentation

Public Class Methods

[](name)

      # File lib/harbor/file_store.rb, line 18
18:     def self.[](name)
19:       file_stores[name]
20:     end

exists?(path)

      # File lib/harbor/file_store.rb, line 22
22:     def self.exists?(path)
23:       @@registrations.each do |registration|
24:         if file_stores[registration].exists?(path) == true
25:           return true
26:         end
27:       end
28:       false
29:     end

file_stores()

      # File lib/harbor/file_store.rb, line 14
14:     def self.file_stores
15:       @@file_stores ||= {}
16:     end

get(path)

      # File lib/harbor/file_store.rb, line 31
31:     def self.get(path)
32:       @@registrations.each do |registration|
33:         if file_stores[registration].exists?(path) == true
34:           return file_stores[registration].get(path)
35:         end
36:       end
37:       nil
38:     end

register(name, store)

      # File lib/harbor/file_store.rb, line 9
 9:     def self.register(name, store)
10:       @@registrations.push name
11:       file_stores[name] = store
12:     end

Public Instance Methods

delete(path)

      # File lib/harbor/file_store.rb, line 44
44:     def delete(path)
45:       raise NotImplementedError.new("You must define your own implementation of FileStore#delete")
46:     end

exists?(path)

      # File lib/harbor/file_store.rb, line 48
48:     def exists?(path)
49:       raise NotImplementedError.new("You must define your own implementation of FileStore#exists?")
50:     end

local?()

Defines whether a file store is local, and thus could be directly copied rather than read and then written.

      # File lib/harbor/file_store.rb, line 64
64:     def local?
65:       raise NotImplementedError.new("You must define your own implementation of FileStore#local?")
66:     end

open(path)

      # File lib/harbor/file_store.rb, line 52
52:     def open(path)
53:       raise NotImplementedError.new("You must define your own implementation of FileStore#open")
54:     end

put(path, file)

      # File lib/harbor/file_store.rb, line 40
40:     def put(path, file)
41:       raise NotImplementedError.new("You must define your own implementation of FileStore#put")
42:     end

size(path)

      # File lib/harbor/file_store.rb, line 56
56:     def size(path)
57:       raise NotImplementedError.new("You must define your own implementation of FileStore#size")
58:     end