Method: Oculus::Storage.create

Defined in:
lib/oculus/storage.rb

.create(options) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/oculus/storage.rb', line 6

def self.create(options)
  case options[:adapter]
  when 'file'
    require 'oculus/storage/file_store'
    FileStore
  when 'sequel'
    require 'oculus/storage/sequel_store'
    SequelStore
  else
    raise AdapterNotFound, "#{options[:adapter]} is not currently implemented. You should write it!"
  end.new(options)
end