Class: Marsdawn::Storage
- Inherits:
-
Object
- Object
- Marsdawn::Storage
- Defined in:
- lib/marsdawn/storage.rb
Defined Under Namespace
Classes: ActiveRecord, Base, FileSystem, Test, TestNotImplementedError
Class Method Summary collapse
Class Method Details
.get(config, opts = {}) ⇒ Object
5 6 7 8 9 10 11 12 |
# File 'lib/marsdawn/storage.rb', line 5 def self.get config, opts={} opts = {key: 'default', lang: 'en', version: '0.0.1'}.merge(opts) config = handle_config(config, opts) raise "No storage type is specified." unless config.key?(:type) class_name = config[:type] @@base_path ||= File.join(File.dirname(__FILE__), 'storage') Marsdawn::Util.adapter(self, class_name, @@base_path).new config, opts end |