Class: Vines::Services::Storage

Inherits:
Object
  • Object
show all
Includes:
Log
Defined in:
lib/vines/services/storage.rb,
lib/vines/services/storage/couchdb.rb

Direct Known Subclasses

CouchDB

Defined Under Namespace

Classes: CouchDB

Constant Summary collapse

@@nicks =
{}

Class Method Summary collapse

Class Method Details

.from_name(name, &block) ⇒ Object



16
17
18
19
20
# File 'lib/vines/services/storage.rb', line 16

def self.from_name(name, &block)
  klass = @@nicks[name.to_sym]
  raise "#{name} storage class not found" unless klass
  klass.new(&block)
end

.register(name) ⇒ Object

Register a nickname that can be used in the config file to specify this storage implementation.



12
13
14
# File 'lib/vines/services/storage.rb', line 12

def self.register(name)
  @@nicks[name.to_sym] = self
end