Module: Aqua
- Defined in:
- lib/aqua.rb,
lib/aqua/object/pack.rb,
lib/aqua/object/stub.rb,
lib/aqua/store/storage.rb,
lib/aqua/object/translator.rb,
lib/aqua/object/initializers.rb,
lib/aqua/object/initializers.rb,
lib/aqua/store/couch_db/server.rb,
lib/aqua/store/couch_db/couch_db.rb,
lib/aqua/store/couch_db/database.rb,
lib/aqua/store/couch_db/result_set.rb,
lib/aqua/store/couch_db/attachments.rb,
lib/aqua/store/couch_db/design_document.rb,
lib/aqua/store/couch_db/storage_methods.rb
Overview
Design documents are responsible for saving views. It is also the place that Aqua will be saving the Class code. There will be one design document per class. There may be additional design documents created without being tied to a class. Don’t know yet.
Defined Under Namespace
Modules: Config, FileInitializations, Initializers, Pack, Query, Store, Tank, Unpack Classes: FileStub, ObjectNotFound, Storage, Stub, Translator
Class Method Summary collapse
-
.include_engine(str) ⇒ Object
private
Loads an external engine from a hash of options.
-
.load_internal_engine(str) ⇒ Object
private
Loads an internal engine from a string.
-
.set_storage_engine(engine = "CouchDB") ⇒ TrueClass
Loads the requested backend storage engine.
Class Method Details
.include_engine(str) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Loads an external engine from a hash of options.
90 91 92 93 94 |
# File 'lib/aqua.rb', line 90 def self.include_engine( str ) Aqua::Storage.class_eval do include str.constantize end end |
.load_internal_engine(str) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Loads an internal engine from a string
81 82 83 84 85 |
# File 'lib/aqua.rb', line 81 def self.load_internal_engine( str ) underscored = str.underscore require "aqua/store/#{underscored}/#{underscored}" include_engine( "Aqua::Store::#{str}::StorageMethods" ) end |
.set_storage_engine(engine) ⇒ TrueClass .set_storage_engine(engine_details) ⇒ TrueClass
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.
65 66 67 68 69 70 71 72 73 74 75 76 77 |
# File 'lib/aqua.rb', line 65 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 |