Module: Aqua
Aqua
Public Visibility
Public Class Method Summary
include_engine(str) |
Loads an external engine from a hash of options. |
---|---|
load_internal_engine(str) |
Loads an internal engine from a string. |
set_storage_engine(engine) set_storage_engine(engine_details) |
Loads the requested backend storage engine. Returns: TrueClass |
Public Class Method Details
include_engine
public
include_engine(str)
Loads an external engine from a hash of options.
[View source]
89 90 91 92 93 |
# File 'lib/aqua.rb', line 89 def self.include_engine( str ) Aqua::Storage.class_eval do include str.constantize end end |
load_internal_engine
public
load_internal_engine(str)
Loads an internal engine from a string
[View source]
80 81 82 83 84 |
# File 'lib/aqua.rb', line 80 def self.load_internal_engine( str ) underscored = str.underscore require "aqua/store/#{underscored}/#{underscored}" include_engine( "Aqua::Store::#{str}::StorageMethods" ) end |
set_storage_engine
public
set_storage_engine(engine)
public
set_storage_engine(engine_details)
Loads the requested backend storage engine. Used early on in configuration. If not declared in configuration, will be called automatically with default engine, at runtime, when needed.
Overloads
public
set_storage_engine(engine)
Loads an Aqua internal library.
public
set_storage_engine(engine_details)
Loads any engine provided a path to the self-loading library and the module full name
[View source]
64 65 66 67 68 69 70 71 72 73 74 75 76 |
# File 'lib/aqua.rb', line 64 def self.set_storage_engine( engine="CouchDB" ) if engine.class == String load_internal_engine( engine ) true elsif engine.class == Hash engine = Mash.new( engine ) require engine[:require] include_engine( engine[:module] ) true else raise ArgumentError, 'engine must be a string relating to an internal Aqua library store, or a hash of values indicating where to find the external library' end end |