Class: ExtraLoop::Storage::RemoteStore
- Inherits:
-
Object
- Object
- ExtraLoop::Storage::RemoteStore
- Defined in:
- lib/extraloop/redis-storage/remote_store.rb
Direct Known Subclasses
Constant Summary collapse
- @@config =
{}
Class Method Summary collapse
-
.get_transport(datastore, credentials = nil, options = {}) ⇒ Object
Instanciates the relevant transport class for the selected datastore.
Instance Method Summary collapse
-
#initialize(credentials, options = {}) ⇒ RemoteStore
constructor
A new instance of RemoteStore.
Constructor Details
#initialize(credentials, options = {}) ⇒ RemoteStore
Returns a new instance of RemoteStore.
12 13 14 15 16 17 18 19 |
# File 'lib/extraloop/redis-storage/remote_store.rb', line 12 def initialize(credentials, ={}) datastore = self.class.to_s.snake_case.split('/').last.to_sym load_config @options = @credentials = credentials || config_for([:datastore, datastore]) raise ExtraLoop::Storage::Exceptions::MissingCredentialsError.new "Missing credentials for '#{datastore}' remote store" unless @credentials @api = nil end |
Class Method Details
.get_transport(datastore, credentials = nil, options = {}) ⇒ Object
Instanciates the relevant transport class for the selected datastore
7 8 9 10 |
# File 'lib/extraloop/redis-storage/remote_store.rb', line 7 def self.get_transport(datastore, credentials=nil, ={}) classname = datastore.to_s.camel_case ExtraLoop::Storage.const_get(classname).new(credentials, ) if ExtraLoop::Storage.const_defined?(classname) end |