[IC:SymbolHash{:$Aqua::Unpack::ClassMethods#loado:$YARD::CodeObjects::MethodObject:@namespaceo:$YARD::CodeObjects::ModuleObject;o; ;o:YARD::CodeObjects::Proxy;o:"YARD::CodeObjects::RootObject;0:@instance_mixinsIC:&YARD::CodeObjects::CodeObjectList[: @owner@ :@attributesIC;{: instanceIC;{:@symbolize_valueT: classIC;{;T;T:@docstringIC:YARD::Docstring" : @all":@ref_tags[: @object@ :@tag_factoryo:YARD::Tags::Library: @factoryo:YARD::Tags::DefaultFactory: @tags[: @files[:@class_mixinsIC; [;@ : @name: root:@current_file_has_commentsF:@childrenIC; [o; ;@ ; IC; [;@;IC;{;IC;{;T;IC;{;T;T;IC;" Aqua ;[" Aqua :@line_rangeo: Range: beginic: exclF:endic;[;@;o;;@;[;[ ["(lib/aqua/store/couch_db/couch_db.rbi ["(lib/aqua/store/couch_db/database.rbi["&lib/aqua/store/couch_db/server.rbi ["/lib/aqua/store/couch_db/storage_methods.rbi ["lib/aqua/store/storage.rbi4["lib/aqua.rbi(;IC; [;@;: Aqua;!T;"IC; [o; ;@; IC; [;@4;IC;{;IC;{;T;IC;{;T;T;IC;" Store ;[" Store;#o;$;%in;&F;'in;[;@4;o;;@;[;[ [@'i [@)i [@+i [@-i ;IC; [;@4;: Store;!T;"IC; [o; ;@4; IC; [;@G;IC;{;IC;{;T;IC;{;T;T;IC;" CouchDB ;[" CouchDB;#o;$;%im;&F;'im;[;@G;o;;@;[;[ [@'i [@)i [@+i [@-i ;IC; [;@G;: CouchDB;!T;"IC; [o:#YARD::CodeObjects::ClassObject;@G; IC; [;@Z;IC;{;IC;{;T;IC;{;T;T;IC;" ;";#0;[;@Z;o;;@;[;[[@'i;IC; [;@Z;:ResourceNotFound;!F;"IC; [;@Z: @aliases{:@superclasso; ;@G;: IOError: @obj0;[o;+;@G; IC; [;@k;IC;{;IC;{;T;IC;{;T;T;IC;" ;";#0;[;@k;o;;@;[;[[@'i;IC; [;@k;:RequestFailed;!F;"IC; [;@k;-{;.o; ;@G;;/;00;[o;+;@G; IC; [;@|;IC;{;IC;{;T;IC;{;T;T;IC;" ;";#0;[;@|;o;;@;[;[[@'i;IC; [;@|;:RequestTimeout;!F;"IC; [;@|;-{;.o; ;@G;;/;00;[o;+;@G; IC; [;@;IC;{;IC;{;T;IC;{;T;T;IC;" ;";#0;[;@;o;;@;[;[[@'i;IC; [;@;:ServerBrokeConnection;!F;"IC; [;@;-{;.o; ;@G;;/;00;[o;+;@G; IC; [;@;IC;{;IC;{;T;IC;{;T;T;IC;" ;";#0;[;@;o;;@;[;[[@'i;IC; [;@;: Conflict;!F;"IC; [;@;-{;.o; ;@G;:ArgumentError;00;[o;;@G: @linei:@visibility: public:@explicitT;IC;"kReturns a string describing the http adapter in use, or loads the default and returns a similar string ;["kReturns a string describing the http adapter in use, or loads the default and returns a similar string"E@return [String] A string identifier for the HTTP adapter in use;#o;$;%i;&F;'i;[;@;o;;@;[o:YARD::Tags::Tag : @types[" String: @text"4A string identifier for the HTTP adapter in use;@:@tag_name" return;0;[[@'i:@signature"Ldef self.http_adapter @adapter ||= set_http_adapter end : @source">def self.http_adapter @adapter ||= set_http_adapter end;:http_adapter;!T: @scope;:@parameters[;[o;;@G;6i*;7;8;9T;IC;"Sets a class variable with the library name that will be loaded. Then attempts to load said library from the adapter directory. It is extended into the HttpAbstraction module. Then the RestAPI which references the HttpAbstraction module is loaded/extended into Aqua this makes available Aqua.get 'http:://someaddress.com' and other requests Loads an http_adapter from the internal http_client libraries. Right now there is only the RestClient Adapter. Other adapters will be added when people get motivated to write and submit them. By default the RestClientAdapter is used, and if the CouchDB module is used without prior configuration it is automatically loaded. ;["ESets a class variable with the library name that will be loaded."CThen attempts to load said library from the adapter directory."LIt is extended into the HttpAbstraction module. Then the RestAPI which "Greferences the HttpAbstraction module is loaded/extended into Aqua"Pthis makes available Aqua.get 'http:://someaddress.com' and other requests "`Loads an http_adapter from the internal http_client libraries. Right now there is only the "iRestClient Adapter. Other adapters will be added when people get motivated to write and submit them."lBy default the RestClientAdapter is used, and if the CouchDB module is used without prior configuration" it is automatically loaded.""@param [optional, String] Maps to the HTTP Client Adapter module name, file name is inferred by removing the 'Adapter' suffix and underscoring the string "8@return [String] Name of HTTP Client Adapter module"O@see Aqua::Store::CouchDB::RestAPI Has detail about the required interface"@api public;#o;$;%i;&F;'i(;[;@;o;;@;[ o;: ;;[" optional" String;<"to the HTTP Client Adapter module name, file name is inferred by removing the 'Adapter' suffix and underscoring the string;@;=" param;" Mapso;: ;;[" String;<"'Name of HTTP Client Adapter module;@;=" return;0o;: ;;0;<",Has detail about the required interface;@;="see;""Aqua::Store::CouchDB::RestAPIo;: ;;0;<" public;@;="api;0;[[@'i*;>"def self.set_http_adapter( mod_string='RestClientAdapter' ) # what is happening here: # strips the Adapter portion of the module name to get at the client name # convention over configurationing to get the file name as it relates to files in http_client/adapter # require the hopefully found file # modify the RestAPI class to extend the Rest methods from the adapter # add the RestAPI to Aqua for easy access throughout the library @adapter = mod_string mod = @adapter.gsub(/Adapter/, '') file = mod.underscore require File.dirname(__FILE__) + "/http_client/adapter/#{file}" RestAPI.adapter = "#{mod_string}".constantize extend(::RestAPI) @adapter # return the adapter end;?"def self.set_http_adapter( mod_string='RestClientAdapter' ) # what is happening here: # strips the Adapter portion of the module name to get at the client name # convention over configurationing to get the file name as it relates to files in http_client/adapter # require the hopefully found file # modify the RestAPI class to extend the Rest methods from the adapter # add the RestAPI to Aqua for easy access throughout the library @adapter = mod_string mod = @adapter.gsub(/Adapter/, '') file = mod.underscore require File.dirname(__FILE__) + "/http_client/adapter/#{file}" RestAPI.adapter = "#{mod_string}".constantize extend(::RestAPI) @adapter # return the adapter end;:set_http_adapter;!T;A;;B[["mod_string"'RestClientAdapter';[o;;@G;6i?;7;8;9T;IC;"PCache of CouchDB Servers used by Aqua. Each is identified by its namespace. ;["PCache of CouchDB Servers used by Aqua. Each is identified by its namespace.""@api private;#o;$;%i<;&F;'i>;[;@;o;;@;[o;: ;;0;<" private;@;="api;0;[[@'i?;>"7def self.servers @servers ||= {} end;?"+def self.servers @servers ||= {} end;: servers;!T;A;;B[;[o;;@G;6iI;7;8;9T;IC;"Reader for getting or initializtion and getting a server by namespace. Used by various parts of store to define storage strategies. Also conserves memory so that there is only one instance of a Server per namespace. ;[ "jReader for getting or initializtion and getting a server by namespace. Used by various parts of store"kto define storage strategies. Also conserves memory so that there is only one instance of a Server per"namespace. ""%@param [String] Server Namespace"@api private;#o;$;%iC;&F;'iH;[;@;o;;@;[o;: ;;[" String;<"Namespace;@;=" param;" Servero;: ;;0;<" private;@;="api;0;[[@'iI;>"def self.server( namespace=nil ) namespace ||= :aqua namespace = namespace.to_sym unless namespace.class == Symbol s = servers[ namespace ] s = servers[namespace.to_sym] = Server.new( :namespace => namespace ) unless s s end;?"def self.server( namespace=nil ) namespace ||= :aqua namespace = namespace.to_sym unless namespace.class == Symbol s = servers[ namespace ] s = servers[namespace.to_sym] = Server.new( :namespace => namespace ) unless s s end;: server;!T;A;;B[["namespace"nil;[o;;@G;6iU;7;8;9T;IC;"tClears the cached servers. So far this is most useful for testing. API will depend on usefulness outside this. ;[ "HClears the cached servers. So far this is most useful for testing. "1API will depend on usefulness outside this. ""@api private;#o;$;%iQ;&F;'iT;[;@!;o;;@;[o;: ;;0;<" private;@!;="api;0;[[@'iU;>"The method breaks the parameters into a url query string.""C@param [String] The base url upon which to attach query params"Y@param [optional Hash] A series of key value pairs that define the url query params "@api semi-public;#o;$;%iZ;&F;'ia;[;@5;o;;@;[o;: ;;[" String;<"/base url upon which to attach query params;@5;=" param;"Theo;: ;;["optional Hash;<"?series of key value pairs that define the url query params;@5;=" param;"Ao;: ;;0;<"semi-public;@5;="api;0;[[@'ic;>"Cdef self.paramify_url( url, params = {} ) if params && !params.empty? query = params.collect do |k,v| v = v.to_json if %w{key startkey endkey}.include?(k.to_s) "#{k}=#{CGI.escape(v.to_s)}" end.join("&") url = "#{url}?#{query}" end url end ;?" def self.paramify_url( url, params = {} ) if params && !params.empty? query = params.collect do |k,v| v = v.to_json if %w{key startkey endkey}.include?(k.to_s) "#{k}=#{CGI.escape(v.to_s)}" end.join("&") url = "#{url}?#{query}" end url end;:paramify_url;!T;A;;B[["url0[" params"{};[o;;@G;6iv;7;8;9T;IC;"A convenience method for escaping a string, namespaced classes with :: notation will be converted to __ all other non-alpha numeric characters besides hyphens and underscores are removed ;[ "0A convenience method for escaping a string,"Anamespaced classes with :: notation will be converted to __ "Xall other non-alpha numeric characters besides hyphens and underscores are removed ""$@param [String] to be converted"@return [String] converted""@api private;#o;$;%in;&F;'iu;[;@^;o;;@;[o;: ;;[" String;<"be converted;@^;=" param;"too;: ;;[" String;<"converted;@^;=" return;0o;: ;;0;<" private;@^;="api;0;[[@'iv;>"wdef self.escape( str ) str.gsub!('::', '__') str.gsub!(/[^a-z0-9\-_]/, '') str end ;?"]def self.escape( str ) str.gsub!('::', '__') str.gsub!(/[^a-z0-9\-_]/, '') str end;: escape;!T;A;;B[["str0;[o;;@G;6i;7;8;9T;IC;" ;";#0;[;@;o;;@;[;[[@'i;>" def method_missing( method, *args ) if @adapter.nil? set_http_adapter # loads up the adapter related stuff send( method.to_sym, eval(args.map{|value| "'#{value}'"}.join(', ')) ) else raise NoMethodError end end;?"def method_missing( method, *args ) if @adapter.nil? set_http_adapter # loads up the adapter related stuff send( method.to_sym, eval(args.map{|value| "'#{value}'"}.join(', ')) ) else raise NoMethodError end end;:method_missing;!F;A;;B[[" method0[" *args0;[o;+;@G; IC; [;@;IC;{;IC;{ :bulk_cacheIC;{: writeo;;@;7;8;IC;"$Sets the attribute +bulk_cache+ ;"aSets the attribute +bulk_cache+ @param value the value to set the attribute +bulk_cache+ to.;#0;[;@;o;;@;[o;: ;;0;<"4the value to set the attribute +bulk_cache+ to.;@;=" param;" value;[[@)i ;>"def bulk_cache=(value);?"5def bulk_cache=(value) @bulk_cache = value end;:bulk_cache=;!F;A;;B[;[: reado;;@;7;8;IC;"0Returns the value of attribute +bulk_cache+ ;"0Returns the value of attribute +bulk_cache+;#0;[;@;o;;@;[;[[@)i ;>"def bulk_cache;?"%def bulk_cache @bulk_cache end;;J;!F;A;;B[;[;T;EIC;{;K0;Mo;;@;7;8;IC;",Returns the value of attribute +server+ ;",Returns the value of attribute +server+;#0;[;@;o;;@;[;[[@)i ;>"def server;?"def server @server end;;E;!F;A;;B[;[;T: nameIC;{;K0;Mo;;@;7;8;IC;"*Returns the value of attribute +name+ ;"*Returns the value of attribute +name+;#0;[;@;o;;@;[;[[@)i ;>" def name;?"def name @name end;;N;!F;A;;B[;[;T:uriIC;{;K0;Mo;;@;7;8;IC;")Returns the value of attribute +uri+ ;")Returns the value of attribute +uri+;#0;[;@;o;;@;[;[[@)i ;>" def uri;?"def uri @uri end;;O;!F;A;;B[;[;T;T;IC;{;T;T;IC;" Database ;["Database ;#o;$;%i;&F;'i;[;@;o;;@;[;[[@)i ;IC; [;@;: Database;!T;"IC; [@@@@@o;;@;6i;7;8;9T;IC;"Create a CouchDB database representation from a name. Does not actually create a database on couchdb. It does not ensure that the database actually exists either. Just creates a ruby representation of a ruby database interface. ;["jCreate a CouchDB database representation from a name. Does not actually create a database on couchdb."dIt does not ensure that the database actually exists either. Just creates a ruby representation""of a ruby database interface.""p@param [optional String] Name of database. If not provided server namespace will be used as database name. "@param [optional Hash] Options for initialization. Currently the only option is :server which must be either a CouchDB server object or a symbol representing a server stored in the CouchDB module.".@return [Database] The initialized object""@api public;#o;$;%i;&F;'i;[;@;o;;@;[ o;: ;;["optional String;<"Qof database. If not provided server namespace will be used as database name.;@;=" param;" Nameo;: ;;["optional Hash;<"for initialization. Currently the only option is :server which must be either a CouchDB server object or a symbol representing a server stored in the CouchDB module.;@;=" param;" Optionso;: ;;[" Database;<"The initialized object;@;=" return;0o;: ;;0;<" public;@;="api;0;[[@)i;>"2def initialize( name=nil, opts={}) name = nil if name && name.empty? opts = Mash.new( opts ) unless opts.empty? @name = name if name initialize_server( opts[:server] ) @uri = "#{server.uri}/#{namespaced( name )}" self.bulk_cache = [] end;?"def initialize( name=nil, opts={}) name = nil if name && name.empty? opts = Mash.new( opts ) unless opts.empty? @name = name if name initialize_server( opts[:server] ) @uri = "#{server.uri}/#{namespaced( name )}" self.bulk_cache = [] end;:initialize;!T;A;;B[[" name"nil[" opts"{};[o;;@;6i-;7;8;9T;IC;"Initializes the database server with the option provided. If not option is provided the default CouchDB server is used instead. ;["lInitializes the database server with the option provided. If not option is provided the default CouchDB"server is used instead.""@param [Symbol, Server]"j If server_option argument is a Symbol then the CouchDB server stash will be queried for a matching "W server. CouchDB manages the creation of that server in the stash, if not found. "j If server_option argument is a Server object then then it is added directly to the database object."L No management of the server will be done with CouchDB's server stash."u@raise [ArgumentError] Raised if a server_option is passed in and if that option is neither a Hash nor a Symbol."@return [Server]""@api private;#o;$;%i!;&F;'i,;[;@;o;;@;[ o;: ;;[" Symbol" Server;<"[server_option argument is a Symbol then the CouchDB server stash will be queried for a matching server. CouchDB manages the creation of that server in the stash, if not found. If server_option argument is a Server object then then it is added directly to the database object. No management of the server will be done with CouchDB's server stash.;@;=" param;"Ifo;: ;;["ArgumentError;<"^Raised if a server_option is passed in and if that option is neither a Hash nor a Symbol.;@;=" raise;0o;: ;;[" Server;<";@;=" return;0o;: ;;0;<" private;@;="api;0;[[@)i-;>"_def initialize_server( server_option ) if server_option if server_option.class == Symbol @server = CouchDB.server( server_option ) elsif server_option.class == Aqua::Store::CouchDB::Server @server = server_option # WARNING: this won't get stashed in CouchDB for use with other database. else raise ArgumentError, ":server option must be a symbol identifying a CouchDB server, or a Server object" end else @server = CouchDB.server end @server end;?"def initialize_server( server_option ) if server_option if server_option.class == Symbol @server = CouchDB.server( server_option ) elsif server_option.class == Aqua::Store::CouchDB::Server @server = server_option # WARNING: this won't get stashed in CouchDB for use with other database. else raise ArgumentError, ":server option must be a symbol identifying a CouchDB server, or a Server object" end else @server = CouchDB.server end @server end;:initialize_server;!T;A;;B[["server_option0;[o;;@;6iC;7;8;9T;IC;"Namespaces the database path for the given server. If no name is provided, then the database name is just the Server's namespace. ;[ "iNamespaces the database path for the given server. If no name is provided, then the database name is"!just the Server's namespace.""H@param [String] Name that the database is initialized with, if any."@@return [String] Namespaced database for use as a http path""@api private;#o;$;%i<;&F;'iB;[;@F;o;;@;[o;: ;;[" String;<"3that the database is initialized with, if any.;@F;=" param;" Nameo;: ;;[" String;<"/Namespaced database for use as a http path;@F;=" return;0o;: ;;0;<" private;@F;="api;0;[[@)iC;>"def namespaced( name ) if name "#{server.namespace}_#{CouchDB.escape(@name)}" else server.namespace end end ;?"def namespaced( name ) if name "#{server.namespace}_#{CouchDB.escape(@name)}" else server.namespace end end;:namespaced;!T;A;;B[[" name0;[o;;@;6iS;7;8;9T;IC;"Creates a database representation and PUTs it on the CouchDB server. If successfull returns a database object. If not successful in creating the database on the CouchDB server then, false will be returned. ;[ "JCreates a database representation and PUTs it on the CouchDB server. "LIf successfull returns a database object. If not successful in creating"Ethe database on the CouchDB server then, false will be returned.""<@see Aqua::Store::CouchDB#initialize for option details"e@return [Database, false] Will return the database on success, and false if it did not succeed. ""@api pubilc;#o;$;%iK;&F;'iR;[;@j;o;;@;[o;: ;;0;<"for option details;@j;="see;"$Aqua::Store::CouchDB#initializeo;: ;;[" Database" false;<"JWill return the database on success, and false if it did not succeed.;@j;=" return;0o;: ;;0;<" pubilc;@j;="api;0;[[@)iS;>"Cdef self.create( name=nil, opts={} ) db = new(name, opts) begin CouchDB.put( db.uri ) rescue Exception => e # catch database already exists errors ... unless e.message.match(/412/) db = false end end db end ;?"def self.create( name=nil, opts={} ) db = new(name, opts) begin CouchDB.put( db.uri ) rescue Exception => e # catch database already exists errors ... unless e.message.match(/412/) db = false end end db end;: create;!T;A;;B[[" name"nil[" opts"{};[o;;@;6ih;7;8;9T;IC;"Creates a database representation and PUTs it on the CouchDB server. This version of the #create method raises an error if the PUT request fails. The exception on this, is if the database already exists then the 412 HTTP code will be ignored. ;["JCreates a database representation and PUTs it on the CouchDB server. "RThis version of the #create method raises an error if the PUT request fails. "eThe exception on this, is if the database already exists then the 412 HTTP code will be ignored.""<@see Aqua::Store::CouchDB#initialize for option details"=@return [Database] Will return the database on success. "G@raise HttpAdapter Exceptions depending on the reason for failure.""@api pubilc;#o;$;%i_;&F;'ig;[;@;o;;@;[ o;: ;;0;<"for option details;@;="see;"$Aqua::Store::CouchDB#initializeo;: ;;[" Database;<")Will return the database on success.;@;=" return;0o;: ;;0;<"@HttpAdapter Exceptions depending on the reason for failure.;@;=" raise;0o;: ;;0;<" pubilc;@;="api;0;[[@)ih;>">def self.create!( name=nil, opts={} ) db = new( name, opts ) begin CouchDB.put( db.uri ) rescue Exception => e # catch database already exists errors ... raise e unless e.class == RequestFailed && e.message.match(/412/) end db end ;?"def self.create!( name=nil, opts={} ) db = new( name, opts ) begin CouchDB.put( db.uri ) rescue Exception => e # catch database already exists errors ... raise e unless e.class == RequestFailed && e.message.match(/412/) end db end;: create!;!T;A;;B[[" name"nil[" opts"{};[o;;@;6iw;7;8;9T;IC;"@Checks to see if the database exists on the couchdb server. ;[ "@Checks to see if the database exists on the couchdb server.""[@return [true, false] depending on whether the database already exists in CouchDB land""@api public;#o;$;%ir;&F;'iv;[;@;o;;@;[o;: ;;[" true" false;<"Edepending on whether the database already exists in CouchDB land;@;=" return;0o;: ;;0;<" public;@;="api;0;[[@)iw;>"def exists? begin info true rescue CouchDB::ResourceNotFound false end end ;?"gdef exists? begin info true rescue CouchDB::ResourceNotFound false end end;: exists?;!T;A;;B[;[o;;@;6i|;7;8;9T;IC;"'GET the database info from CouchDB ;["'GET the database info from CouchDB;#o;$;%i{;&F;'i{;[;@;o;;@;[;[[@)i|;>"6def info CouchDB.get( uri ) end;?"&def info CouchDB.get( uri ) end;: info;!T;A;;B[;[o;;@;6i;7;8;9T;IC;"CDeletes a database; use with caution as this isn't reversible. ;[ "CDeletes a database; use with caution as this isn't reversible.""~@return A JSON response on success. nil if the resource is not found. And raises an error if another exception was raised"V@raise Exception related to request failure that is not a ResourceNotFound error.;#o;$;%i;&F;'i;[;@;o;;@;[o;: ;;0;<"vA JSON response on success. nil if the resource is not found. And raises an error if another exception was raised;@;=" return;0o;: ;;0;<"OException related to request failure that is not a ResourceNotFound error.;@;=" raise;0;[[@)i;>"def delete begin CouchDB.delete( uri ) rescue CouchDB::ResourceNotFound nil end end ;?"kdef delete begin CouchDB.delete( uri ) rescue CouchDB::ResourceNotFound nil end end;: delete;!T;A;;B[;[o;;@;6i;7;8;9T;IC;"Deletes a database; use with caution as this isn't reversible. Similar to #delete, except that it will raise an error on failure to find the database. ;[ "XDeletes a database; use with caution as this isn't reversible. Similar to #delete, "Hexcept that it will raise an error on failure to find the database."")@return A JSON response on success. "E@raise Exception related to request failure or ResourceNotFound.;#o;$;%i;&F;'i;[;@;o;;@;[o;: ;;0;<" A JSON response on success.;@;=" return;0o;: ;;0;<">Exception related to request failure or ResourceNotFound.;@;=" raise;0;[[@)i;>">def delete! CouchDB.delete( uri ) end ;?",def delete! CouchDB.delete( uri ) end;: delete!;!T;A;;B[;[o;;@;6i;7;8;9T;IC;"Q# Query the _all_docs view. Accepts all the same arguments as view. ;["Q# Query the _all_docs view. Accepts all the same arguments as view.;#o;$;%i;&F;'i;[;@;o;;@;[;[[@)i;>" def documents(params = {}) keys = params.delete(:keys) url = CouchDB.paramify_url( "#{uri}/_all_docs", params ) if keys CouchDB.post(url, {:keys => keys}) else CouchDB.get url end end ;?"def documents(params = {}) keys = params.delete(:keys) url = CouchDB.paramify_url( "#{uri}/_all_docs", params ) if keys CouchDB.post(url, {:keys => keys}) else CouchDB.get url end end;:documents;!T;A;;B[[" params"{};[o;;@;6i;7;8;9T;IC;"?BULK ACTIVITIES ------------------------------------------ ;["?BULK ACTIVITIES ------------------------------------------;#o;$;%i;&F;'i;[;@&;o;;@;[;[[@)i;>"def add_to_bulk_cache( doc ) if server.uuid_count/2.0 > bulk_cache.size self.bulk_cache << doc else bulk_save self.bulk_cache << doc end end;?"def add_to_bulk_cache( doc ) if server.uuid_count/2.0 > bulk_cache.size self.bulk_cache << doc else bulk_save self.bulk_cache << doc end end;:add_to_bulk_cache;!T;A;;B[["doc0;[o;;@;6i;7;8;9T;IC;" ;";#0;[;@6;o;;@;[;[[@)i;>"def bulk_save docs = bulk_cache self.bulk_cache = [] CouchDB.post( "#{uri}/_bulk_docs", {:docs => docs} ) end;?"xdef bulk_save docs = bulk_cache self.bulk_cache = [] CouchDB.post( "#{uri}/_bulk_docs", {:docs => docs} ) end;:bulk_save;!F;A;;B[;[;@;-{;.o; ;@G;: Object;00;[o;+;@G; IC; [;@E;IC;{;IC;{ :namespaceIC;{;K0;Mo;;@E;7;8;IC;"/Returns the value of attribute +namespace+ ;"/Returns the value of attribute +namespace+;#0;[;@J;o;;@;[;[[@+i;>"def namespace;?"#def namespace @namespace end;;^;!F;A;;B[;[;T:uuid_batch_countIC;{;Ko;;@E;7;8;IC;"*Sets the attribute +uuid_batch_count+ ;"mSets the attribute +uuid_batch_count+ @param value the value to set the attribute +uuid_batch_count+ to.;#0;[;@W;o;;@;[o;: ;;0;<":the value to set the attribute +uuid_batch_count+ to.;@W;=" param;" value;[[@+i ;>"!def uuid_batch_count=(value);?"Adef uuid_batch_count=(value) @uuid_batch_count = value end;:uuid_batch_count=;!F;A;;B[;[;Mo;;@E;7;8;IC;"6Returns the value of attribute +uuid_batch_count+ ;"6Returns the value of attribute +uuid_batch_count+;#0;[;@g;o;;@;[;[[@+i ;>"def uuid_batch_count;?"1def uuid_batch_count @uuid_batch_count end;;_;!F;A;;B[;[;T: uuidsIC;{;Ko;;@E;7;8;IC;"Sets the attribute +uuids+ ;"WSets the attribute +uuids+ @param value the value to set the attribute +uuids+ to.;#0;[;@t;o;;@;[o;: ;;0;<"/the value to set the attribute +uuids+ to.;@t;=" param;" value;[[@+i ;>"def uuids=(value);?"+def uuids=(value) @uuids = value end;: uuids=;!F;A;;B[;[;Mo;;@E;7;8;IC;"+Returns the value of attribute +uuids+ ;"+Returns the value of attribute +uuids+;#0;[;@;o;;@;[;[[@+i ;>"def uuids;?"def uuids @uuids end;;a;!F;A;;B[;[;T;OIC;{;Ko;;@E;7;8;IC;"Sets the attribute +uri+ ;"SSets the attribute +uri+ @param value the value to set the attribute +uri+ to.;#0;[;@;o;;@;[o;: ;;0;<"-the value to set the attribute +uri+ to.;@;=" param;" value;[[@+i ;>"def uri=(value);?"'def uri=(value) @uri = value end;: uri=;!F;A;;B[;[;Mo;;@E;7;8;IC;")Returns the value of attribute +uri+ ;")Returns the value of attribute +uri+;#0;[;@;o;;@;[;[[@+i ;>" def uri;?"def uri @uri end;;O;!F;A;;B[;[;T;T;IC;{;T;T;IC;" Server ;[" Server ;#o;$;%ii;&F;'ii;[;@E;o;;@;[;[[@+i ;IC; [;@E;: Server;!T;"IC; [@@@W@g@t@@Jo;;@E;6i;7;8;9T;IC;" ;";#0;[;@;o;;@;[;[[@+i;>"def initialize(opts={}) opts = Mash.new(opts) unless opts.empty? self.uri = opts[:server] || 'http://127.0.0.1:5984' self.uuid_batch_count = opts[:uuid_batch_count] || 1000 self.namespace = opts[:namespace].to_s end ;?"def initialize(opts={}) opts = Mash.new(opts) unless opts.empty? self.uri = opts[:server] || 'http://127.0.0.1:5984' self.uuid_batch_count = opts[:uuid_batch_count] || 1000 self.namespace = opts[:namespace].to_s end;;Q;!F;A;;B[[" opts"{};[o;;@E;6i;7;8;9T;IC;" ;";#0;[;@;o;;@;[;[[@+i;>"def namespace=( name ) default = 'aqua' name ||= default name = CouchDB.escape( name ) name = default if name.empty? @namespace = name end;?"def namespace=( name ) default = 'aqua' name ||= default name = CouchDB.escape( name ) name = default if name.empty? @namespace = name end;:namespace=;!F;A;;B[[" name0;[o;;@E;6i";7;8;9T;IC;"PDATABASE MANAGMENT ----------------- Lists all database names on the server ;[")DATABASE MANAGMENT -----------------"+Lists all database names on the server;#o;$;%i;&F;'i ;[;@;o;;@;[;[[@+i";>"def database_names dbs = CouchDB.get( "#{@uri}/_all_dbs" ) dbs.select{|name| name.match(/\A#{namespace}_?/)} end;?"ydef database_names dbs = CouchDB.get( "#{@uri}/_all_dbs" ) dbs.select{|name| name.match(/\A#{namespace}_?/)} end;:database_names;!T;A;;B[;[o;;@E;6i';7;8;9T;IC;" ;";#0;[;@;o;;@;[;[[@+i';>"def databases dbs = [] database_names.each do |db_name| dbs << Database.new( db_name.gsub(/\A#{namespace}_|\A#{namespace}\z/, '') , :server => self ) end dbs end ;?"def databases dbs = [] database_names.each do |db_name| dbs << Database.new( db_name.gsub(/\A#{namespace}_|\A#{namespace}\z/, '') , :server => self ) end dbs end;:databases;!F;A;;B[;[o;;@E;6i1;7;8;9T;IC;"|Deletes all databases named for this namespace (i.e. this server) Use with caution ... it is a permanent and undoable change ;["FDeletes all databases named for this namespace (i.e. this server)"?Use with caution ... it is a permanent and undoable change;#o;$;%i/;&F;'i0;[;@;o;;@;[;[[@+i1;>"Ndef delete_all! databases.each{ |db| db.delete! } end ;?"=def delete_all! databases.each{ |db| db.delete! } end;:delete_all!;!T;A;;B[;[o;;@E;6i8;7;8;9T;IC;"Deletes all database with the less exection raising method: database.delete. This will only raise errors related to request problems, and not errors related to the database not being found for deletion. ;["[Deletes all database with the less exection raising method: database.delete. This will"^only raise errors related to request problems, and not errors related to the database not"being found for deletion. ;#o;$;%i5;&F;'i7;[;@;o;;@;[;[[@+i8;>"Ldef delete_all databases.each{ |db| db.delete } end ;?";def delete_all databases.each{ |db| db.delete } end;:delete_all;!T;A;;B[;[o;;@E;6i=;7;8;9T;IC;"5Returns a CouchRest::Database for the given name ;["5Returns a CouchRest::Database for the given name;#o;$;%i<;&F;'i<;[;@;o;;@;[;[[@+i=;>"xdef database(name) db = Database.new( name, :server => self ) db.exists? ? db : nil end;?"`def database(name) db = Database.new( name, :server => self ) db.exists? ? db : nil end;: database;!T;A;;B[[" name0;[o;;@E;6iC;7;8;9T;IC;"-Creates the database if it doesn't exist ;["-Creates the database if it doesn't exist;#o;$;%iB;&F;'iB;[;@ ;o;;@;[;[[@+iC;>"Ydef database!(name) Database.create( name, :server => self ) end;?"Idef database!(name) Database.create( name, :server => self ) end;:database!;!T;A;;B[[" name0;[o;;@E;6iH;7;8;9T;IC;"GET the welcome message ;["GET the welcome message;#o;$;%iG;&F;'iG;[;@0;o;;@;[;[[@+iH;>"9def info CouchDB.get "#{uri}/" end;?")def info CouchDB.get "#{uri}/" end;;W;!T;A;;B[;[o;;@E;6iM;7;8;9T;IC;"!Restart the CouchDB instance ;["!Restart the CouchDB instance;#o;$;%iL;&F;'iL;[;@>;o;;@;[;[[@+iM;>"Fdef restart! CouchDB.post "#{uri}/_restart" end;?"6def restart! CouchDB.post "#{uri}/_restart" end;: restart!;!T;A;;B[;[o;;@E;6iR;7;8;9T;IC;"Ncounts the number of uuids available, used by Database to limit bulk save ;["Ncounts the number of uuids available, used by Database to limit bulk save;#o;$;%iQ;&F;'iQ;[;@L;o;;@;[;[[@+iR;>"def uuid_count if uuids uuids.size else load_uuids uuid_batch_count end end ;?"hdef uuid_count if uuids uuids.size else load_uuids uuid_batch_count end end;:uuid_count;!T;A;;B[;[o;;@E;6i\;7;8;9T;IC;"aRetrive an unused UUID from CouchDB. Server instances manage caching a list of unused UUIDs. ;["aRetrive an unused UUID from CouchDB. Server instances manage caching a list of unused UUIDs.;#o;$;%i[;&F;'i[;[;@Z;o;;@;[;[[@+i\;>"def next_uuid(count = @uuid_batch_count) @uuids ||= [] if uuids.empty? load_uuids(count) end uuids.pop end;?"{def next_uuid(count = @uuid_batch_count) @uuids ||= [] if uuids.empty? load_uuids(count) end uuids.pop end;:next_uuid;!T;A;;B[[" count"@uuid_batch_count;[o;;@E;6id;7;8;9T;IC;" ;";#0;[;@k;o;;@;[;[[@+id;>"def load_uuids( count=@uuid_batch_count ) @uuids = CouchDB.get("#{@uri}/_uuids?count=#{count}")["uuids"] end;?"tdef load_uuids( count=@uuid_batch_count ) @uuids = CouchDB.get("#{@uri}/_uuids?count=#{count}")["uuids"] end;:load_uuids;!F;A;;B[[" count"@uuid_batch_count;[;@E;-{;.o; ;@G;;];00;[o; ;@G; IC; [;@};IC;{;IC;{;T;IC;{;T;T;IC;"CThis module of storage methods was built to be flexible enough to step in as a replacement for CouchRest core or another super lite CouchDB library. A lot of the methods are added for that convenience, and not for the needs of Aqua. Adding the module to a Mash/Hash class is sufficient to get the full core access library. ;[ "`This module of storage methods was built to be flexible enough to step in as a replacement "ffor CouchRest core or another super lite CouchDB library. A lot of the methods are added for that"econvenience, and not for the needs of Aqua. Adding the module to a Mash/Hash class is sufficient")to get the full core access library.""Q@see Aqua::Storage for details on the require methods for a storage library."StoreMethods;#o;$;%i ;&F;'i;[;@};o;;@;[o;: ;;0;<"Kfor details on the require methods for a storage library. StoreMethods;@};="see;"Aqua::Storage;[[@-i;IC; [;@};:StorageMethods;!T;"IC; [o;;@};6i;7;8;9T;IC;" ;";#0;[;@;o;;@;[;[[@-i;>"def self.included( klass ) klass.class_eval do include InstanceMethods extend ClassMethods end end ;?"udef self.included( klass ) klass.class_eval do include InstanceMethods extend ClassMethods end end;: included;!F;A;;B[[" klass0;[o; ;@}; IC; [;@;IC;{;IC;{;T;IC;{;T;T;IC;" ;";#0;[;@;o;;@;[;[[@-i;IC; [;@;:ClassMethods;!F;"IC; [o;;@;6i";7;8;9T;IC;"OInitializes a new storage document and saves it without raising any errors ;[ "OInitializes a new storage document and saves it without raising any errors""@param [Hash, Mash]"n@return [Aqua::Storage, false] On success it returns an aqua storage object. On failure it returns false.""@api public;#o;$;%i;&F;'i!;[;@;o;;@;[o;: ;;[" Hash" Mash;<0;@;=" param;0o;: ;;["Aqua::Storage" false;<"OOn success it returns an aqua storage object. On failure it returns false.;@;=" return;0o;: ;;0;<" public;@;="api;0;[[@-i";>"Xdef create( hash ) doc = new( hash ) doc.save end;?":def create( hash ) doc = new( hash ) doc.save end;;T;!T;A;;B[[" hash0;[o;;@;6i.;7;8;9T;IC;"HInitializes a new storage document and saves it raising any errors. ;[ "HInitializes a new storage document and saves it raising any errors.""@param [Hash, Mash]"K@return [Aqua::Storage] On success it returns an aqua storage object. ")@raise Any of the CouchDB exceptions""@api public;#o;$;%i';&F;'i-;[;@;o;;@;[ o;: ;;[" Hash" Mash;<0;@;=" param;0o;: ;;["Aqua::Storage;<"2On success it returns an aqua storage object.;@;=" return;0o;: ;;0;<""Any of the CouchDB exceptions;@;=" raise;0o;: ;;0;<" public;@;="api;0;[[@-i.;>"Zdef create!( hash ) doc = new( hash ) doc.save! end;?"@;?"?def commit( defer=false ) save_logic( defer, false ) end;: save!;!F;A;;B[;[o;;@;6ih;7;8;9T;IC;"EInternal logic used by save, save! and commit to save an object. ;[ "EInternal logic used by save, save! and commit to save an object.""|@param [optional true, false] Determines whether a object cached for save in the database in bulk. By default this is false."j@param [optional true, false] Determines whether an exception is raised or whether false is returned."b@return [Aqua::Storage, false] Depening on the type of execption masking and also the outcome"*@raise Any of the CouchDB execptions.""@api private;#o;$;%i`;&F;'ig;[;@;o;;@;[ o;: ;;["optional true" false;<"Xwhether a object cached for save in the database in bulk. By default this is false.;@;=" param;"Determineso;: ;;["optional true" false;<"Awhether an exception is raised or whether false is returned.;@;=" param;"Determineso;: ;;["Aqua::Storage" false;<"CDepening on the type of execption masking and also the outcome;@;=" return;0o;: ;;0;<"#Any of the CouchDB execptions.;@;=" raise;0o;: ;;0;<" private;@;="api;0;[[@-ih;>"def save_logic( defer=false, mask_exception = true ) encode_attachments if self[:_attachment] ensure_id if defer database.add_to_bulk_cache( self ) else # clear any bulk saving left over ... database.bulk_save if database.bulk_cache.size > 0 if mask_exception save_now else save_now( false ) end end end ;?"fdef save_logic( defer=false, mask_exception = true ) encode_attachments if self[:_attachment] ensure_id if defer database.add_to_bulk_cache( self ) else # clear any bulk saving left over ... database.bulk_save if database.bulk_cache.size > 0 if mask_exception save_now else save_now( false ) end end end;:save_logic;!T;A;;B[[" defer" false["mask_exception" true;[o;;@;6i;7;8;9T;IC;"hInternal logic used by save_logic to save an object immediately instead of deferring for bulk save. ;[ "hInternal logic used by save_logic to save an object immediately instead of deferring for bulk save.""j@param [optional true, false] Determines whether an exception is raised or whether false is returned."b@return [Aqua::Storage, false] Depening on the type of execption masking and also the outcome"*@raise Any of the CouchDB execptions.""@api private;#o;$;%ix;&F;'i~;[;@;o;;@;[ o;: ;;["optional true" false;<"Awhether an exception is raised or whether false is returned.;@;=" param;"Determineso;: ;;["Aqua::Storage" false;<"CDepening on the type of execption masking and also the outcome;@;=" return;0o;: ;;0;<"#Any of the CouchDB execptions.;@;=" raise;0o;: ;;0;<" private;@;="api;0;[[@-i;>"def save_now( mask_exception = true ) begin result = CouchDB.put( uri, self ) rescue Exception => e if mask_exception result = false else raise e end end if result && result['ok'] update_version( result ) self else result end end;?"%def save_now( mask_exception = true ) begin result = CouchDB.put( uri, self ) rescue Exception => e if mask_exception result = false else raise e end end if result && result['ok'] update_version( result ) self else result end end;: save_now;!T;A;;B[["mask_exception" true;[o;;@;6i;7;8;9T;IC;"+couchdb database url for this document ;["+couchdb database url for this document"<@return [String] representing CouchDB uri for document "@api public;#o;$;%i;&F;'i;[;@;o;;@;[o;: ;;[" String;<"*representing CouchDB uri for document;@;=" return;0o;: ;;0;<" public;@;="api;0;[[@-i;>"Fdef uri database.uri + '/' + ensure_id end ;?"1def uri database.uri + '/' + ensure_id end;;O;!T;A;;B[;[o;;@;6i;7;8;9T;IC;")retrieves self from CouchDB database ;[")retrieves self from CouchDB database"1@return [Hash] representing the CouchDB data"@api public;#o;$;%i;&F;'i;[;@;o;;@;[o;: ;;[" Hash;<""representing the CouchDB data;@;=" return;0o;: ;;0;<" public;@;="api;0;[[@-i;>"Rdef retrieve self.class.new( CouchDB.get( uri ) ) end ;?" self['_id'], '_rev' => rev, '_deleted' => true } ) else begin delete_now rescue Exception => e if mask_exceptions || e.class == CouchDB::ResourceNotFound false else raise e end end end end ;?"ldef delete_logic( defer = false, mask_exceptions = true ) if defer database.add_to_bulk_cache( { '_id' => self['_id'], '_rev' => rev, '_deleted' => true } ) else begin delete_now rescue Exception => e if mask_exceptions || e.class == CouchDB::ResourceNotFound false else raise e end end end end;:delete_logic;!T;A;;B[[" defer" false["mask_exceptions" true;[o;;@;6i;7;8;9T;IC;"GInternal logic used by delete_logic delete a resource immediately. ;[ "GInternal logic used by delete_logic delete a resource immediately.""[@return [String, false] Depening on the type of execption masking and also the outcome"*@raise Any of the CouchDB execptions.""@api private;#o;$;%i;&F;'i;[;@;o;;@;[o;: ;;[" String" false;<"CDepening on the type of execption masking and also the outcome;@;=" return;0o;: ;;0;<"#Any of the CouchDB execptions.;@;=" raise;0o;: ;;0;<" private;@;="api;0;[[@-i;>"def delete_now revisions.each do |rev_id| CouchDB.delete( "#{uri}?rev=#{rev_id}" ) end true end;?"rdef delete_now revisions.each do |rev_id| CouchDB.delete( "#{uri}?rev=#{rev_id}" ) end true end;:delete_now;!T;A;;B[;[o;;@;6i;7;8;9T;IC;"ZGets revision history, which is needed by Delete to remove all versions of a document ;[ "ZGets revision history, which is needed by Delete to remove all versions of a document""=@return [Array] Containing strings with revision numbers""@api semi-private;#o;$;%i;&F;'i;[;@;o;;@;[o;: ;;[" Array;<"-Containing strings with revision numbers;@;=" return;0o;: ;;0;<"semi-private;@;="api;0;[[@-i;>"def revisions active_revisions = [] begin hash = CouchDB.get( "#{uri}?revs_info=true" ) rescue return active_revisions end hash['_revs_info'].each do |rev_hash| active_revisions << rev_hash['rev'] if ['disk', 'available'].include?( rev_hash['status'] ) end active_revisions end ;?"5def revisions active_revisions = [] begin hash = CouchDB.get( "#{uri}?revs_info=true" ) rescue return active_revisions end hash['_revs_info'].each do |rev_hash| active_revisions << rev_hash['rev'] if ['disk', 'available'].include?( rev_hash['status'] ) end active_revisions end;:revisions;!T;A;;B[;[@o;;@;6i;7;8;9T;IC;"Sretrieves the previously set database or sets the new one with a default value ;["Sretrieves the previously set database or sets the new one with a default value"-@return [Aqua::Store::CouchDB::Database]"@api private;#o;$;%i;&F;'i;[;@;o;;@;[o;: ;;["#Aqua::Store::CouchDB::Database;<";@;=" return;0o;: ;;0;<" private;@;="api;0;[[@-i;>"Ndef database @database ||= determine_database end ;?"8def database @database ||= determine_database end;;j;!T;A;;B[;[o;;@;6i;7;8;9T;IC;" Looks to CouchDB.database_strategy for information about how the CouchDB store has generally been configured to store its data across databases and/or servers. In some cases the class for the parent object has configuration details about the database and server to use. ;[ "aLooks to CouchDB.database_strategy for information about how the CouchDB store has generally"cbeen configured to store its data across databases and/or servers. In some cases the class for"Vthe parent object has configuration details about the database and server to use."9@todo Build the strategies in CouchDB. Use them here"@api private;#o;$;%i;&F;'i;[;@ ;o;;@;[o;: ;;0;<";@ ;=" todo;"3Build the strategies in CouchDB. Use them hereo;: ;;0;<" private;@ ;="api;0;[[@-i;>"~def determine_database Database.create # defaults to database 'aqua' using default server :aqua end ;?"mdef determine_database Database.create # defaults to database 'aqua' using default server :aqua end;:determine_database;!T;A;;B[;[o;;@;6i;7;8;9T;IC;"ssetters and getters couchdb document specifics ------------------------- Gets the document id. In this engine id and _id are different data. The main reason for this is that CouchDB needs a relatively clean string as the key, where as the user can assign a messy string to the id. The user can continue to use the messy string since the engine also has access to the _id. ;[ "Msetters and getters couchdb document specifics -------------------------"iGets the document id. In this engine id and _id are different data. The main reason for this is that"gCouchDB needs a relatively clean string as the key, where as the user can assign a messy string to"gthe id. The user can continue to use the messy string since the engine also has access to the _id.""@return [String]""@api public ;#o;$;%i;&F;'i;[;@$;o;;@;[o;: ;;[" String;<";@$;=" return;0o;: ;;0;<" public ;@$;="api;0;[[@-i;>"/def id self[:id] end;?"def id self[:id] end;:id;!T;A;;B[;[o;;@;6i;7;8;9T;IC;"Allows the id to be set. If the id is changed after creation, then the CouchDB document for the old id is deleted, and the _rev is set to nil, making it a new document. The id can only be a string (right now). ;[ "hAllows the id to be set. If the id is changed after creation, then the CouchDB document for the old"rid is deleted, and the _rev is set to nil, making it a new document. The id can only be a string (right now).""k@return [String, false] Will return the string it received if it is indeed a string. Otherwise it will"return false.""@api public ;#o;$;%i ;&F;'i;[;@A;o;;@;[o;: ;;[" String" false;<"aWill return the string it received if it is indeed a string. Otherwise it will return false.;@A;=" return;0o;: ;;0;<" public ;@A;="api;0;[[@-i;>"def id=( str ) if str.respond_to?(:match) escaped = escape_for_id( str ) # CLEANUP: do a bulk delete request on the old id, now that it has changed delete(true) if !new? && escaped != self[:_id] self[:id] = str self[:_id] = escaped str end end ;?"def id=( str ) if str.respond_to?(:match) escaped = escape_for_id( str ) # CLEANUP: do a bulk delete request on the old id, now that it has changed delete(true) if !new? && escaped != self[:_id] self[:id] = str self[:_id] = escaped str end end;:id=;!T;A;;B[["str0;[o;;@;6i$;7;8;9T;IC;"2Returns CouchDB document revision identifier. ;[ "2Returns CouchDB document revision identifier.""@return [String]""@api semi-public;#o;$;%i;&F;'i#;[;@`;o;;@;[o;: ;;[" String;<";@`;=" return;0o;: ;;0;<"semi-public;@`;="api;0;[[@-i$;>"2def rev self[:_rev] end;?"def rev self[:_rev] end;:rev;!T;A;;B[;[o;;@;6i);7;8;9T;IC;" ;";#0;[;@z;o;;@;[;[[@-i);>"Gdef rev=( str ) self[:_rev] = str end ;?",def rev=( str ) self[:_rev] = str end;: rev=;!F;A;;B[["str0;[o;;@;6i1;7;8;9T;IC;"CUpdates the id and rev after a document is successfully saved. ;["CUpdates the id and rev after a document is successfully saved.";@param [Hash] Result returned by CouchDB document save"@api private;#o;$;%i.;&F;'i0;[;@;o;;@;[o;: ;;[" Hash;<"&returned by CouchDB document save;@;=" param;" Resulto;: ;;0;<" private;@;="api;0;[[@-i1;>"|def update_version( result ) self.id = result['id'] self.rev = result['rev'] end ;?"adef update_version( result ) self.id = result['id'] self.rev = result['rev'] end;:update_version;!T;A;;B[[" result0;[o;;@;6i9;7;8;9T;IC;"UReturns true if the document has never been saved or false if it has been saved. ;["UReturns true if the document has never been saved or false if it has been saved."@return [true, false]"@api public;#o;$;%i6;&F;'i8;[;@;o;;@;[o;: ;;[" true" false;<";@;=" return;0o;: ;;0;<" public;@;="api;0;[[@-i9;>",def new? !rev end;?"def new? !rev end;: new?;!T;A;;B[;[o;;@;7;8;IC;" ;0;#0;[;@;o;;@;[;[[@-i<[@-i<;>@;?"def new? !rev end;:new_document?;!F;A;;B[;[o;;@;6iA;7;8;9T;IC;"dReturns true if a document exists at the CouchDB uri for this document. Otherwise returns false ;["dReturns true if a document exists at the CouchDB uri for this document. Otherwise returns false"@return [true, false]"@api public;#o;$;%i>;&F;'i@;[;@;o;;@;[o;: ;;[" true" false;<";@;=" return;0o;: ;;0;<" public;@;="api;0;[[@-iA;>"def exists? begin CouchDB.get uri true rescue false end end ;?"Wdef exists? begin CouchDB.get uri true rescue false end end;;V;!T;A;;B[;[o;;@;6iL;7;8;9T;IC;"Ugets a uuid from the server if one doesn't exist, otherwise escapes existing id. ;["Ugets a uuid from the server if one doesn't exist, otherwise escapes existing id."@api private;#o;$;%iJ;&F;'iK;[;@;o;;@;[o;: ;;0;<" private;@;="api;0;[[@-iL;>"mdef ensure_id self[:_id] = ( id ? escape_doc_id : database.server.next_uuid ) end ;?"Xdef ensure_id self[:_id] = ( id ? escape_doc_id : database.server.next_uuid ) end;:ensure_id;!T;A;;B[;[o;;@;6iR;7;8;9T;IC;"YEscapes document id. Different strategies for design documents and normal documents. ;["YEscapes document id. Different strategies for design documents and normal documents."@api private;#o;$;%iP;&F;'iQ;[;@;o;;@;[o;: ;;0;<" private;@;="api;0;[[@-iR;>"Ddef escape_doc_id escape_for_id( id ) end;?"0def escape_doc_id escape_for_id( id ) end;:escape_doc_id;!T;A;;B[;[o;;@;6iX;7;8;9T;IC;""Escapes a string for id usage ;[""Escapes a string for id usage"@api private;#o;$;%iV;&F;'iW;[;@;o;;@;[o;: ;;0;<" private;@;="api;0;[[@-iX;>"def escape_for_id( str ) str.match(/^_design\/(.*)/) ? "_design/#{CGI.escape($1)}" : CGI.escape(str) end ;?"odef escape_for_id( str ) str.match(/^_design\/(.*)/) ? "_design/#{CGI.escape($1)}" : CGI.escape(str) end;:escape_for_id;!T;A;;B[["str0;[;@;-{@;v@;;[;@};-{;[;@G;-{;[;@4;-{;[o;+;@; IC; [;@ ;IC;{;IC;{;T;IC;{;T;T;IC;" Storage ;["Storage ;#o;$;%i?;&F;'i?;[;@ ;o;;@;[;[[@/i5;IC; [;@ ;: Storage;!T;"IC; [o;;@ ;6i7;7;8;9T;IC;"cauto loads the default store to CouchDB if Store is used without Aqua configuration of a store ;["dauto loads the default store to CouchDB if Store is used without Aqua configuration of a store ;#o;$;%i6;&F;'i6;[;@0;o;;@;[;[[@/i7;>"def method_missing( method, *args ) if respond_to?( :commit ) raise NoMethodError else Aqua.set_storage_engine # to default, currently CouchDB send( method.to_sym, eval(args.map{|value| "'#{value}'"}.join(', ')) ) # resend! end end;?"def method_missing( method, *args ) if respond_to?( :commit ) raise NoMethodError else Aqua.set_storage_engine # to default, currently CouchDB send( method.to_sym, eval(args.map{|value| "'#{value}'"}.join(', ')) ) # resend! end end;;I;!T;A;;B[[" method0[" *args0;[;@ ;-{;.o; ;@;: Mash;00;[o;+;@; IC; [;@E;IC;{;IC;{;T;IC;{;T;T;IC;" ;";#0;[;@E;o;;@;[;[[@1i);IC; [;@E;:ObjectNotFound;!F;"IC; [;@E;-{;.o; ;@;;/;00;[o;;@;6iD;7;8;9T;IC;"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. ;["QLoads the requested backend storage engine. Used early on in configuration. "QIf not declared in configuration, will be called automatically with default "%engine, at runtime, when needed.""+@overload set_storage_engine( engine )"& Loads an Aqua internal library."L @param [String] CamelCase string defining the overarching engine type"3@overload set_storage_engine( engine_details )"\ Loads any engine provided a path to the self-loading library and the module full name"K @param [Hash] options that describe how to find the external library"` @option engine_details [String] :require The path or gem name used in a require statement"O @option engine_details [String] :module String with the full module name"*@return [TrueClass] when successful. "I@raise [ArgumentError] when argument is neither a Hash nor a String.""4@example Internal library loading from a string"+ Aqua.set_storage_engine( "CouchDB" )""@example External library loading from a gem. :module argument is the gem's module responsible for implementing the storage methods"r Aqua.set_storage_engine( :require => 'my_own/storage_gem', :module => 'MyOwn::StorageGem::StorageMethods' )""H@example External library loading from a non-gem external library. "v Aqua.set_storage_engine( :require => '/absolute/path/to/library', :module => 'My::StorageLib::StorageMethods' )""@api public;#o;$;%i+;&F;'iC;[;@V;o;;@;[ o:YARD::Tags::OverloadTag ;;0;<0;IC;"$Loads an Aqua internal library. ;"jLoads an Aqua internal library. @param [String] CamelCase string defining the overarching engine type;[;@V;o;;@;[o;: ;;[" String;<"0string defining the overarching engine type;0;=" param;"CamelCase;@V;>"!set_storage_engine( engine );=" overload;:set_storage_engine;B[[: engine0o; ;;0;<0;IC;"ZLoads any engine provided a path to the self-loading library and the module full name ;"=Loads any engine provided a path to the self-loading library and the module full name @param [Hash] options that describe how to find the external library @option engine_details [String] :require The path or gem name used in a require statement @option engine_details [String] :module String with the full module name;[;@V;o;;@;[o;: ;;[" Hash;<"3that describe how to find the external library;0;=" param;" optionso:YARD::Tags::OptionTag ;;0;<0;0: @pairo:YARD::Tags::DefaultTag ;;[" String:@defaults0;<"5The path or gem name used in a require statement;=" option;" :require;=" option;"engine_detailso; ;;0;<0;0;o; ;;[" String;0;<"%String with the full module name;=" option;" :module;=" option;"engine_details;@V;>")set_storage_engine( engine_details );=" overload;;;B[[:engine_details0o;: ;;["TrueClass;<"when successful.;@V;=" return;0o;: ;;["ArgumentError;<"2when argument is neither a Hash nor a String.;@V;=" raise;0o;: ;;0;<"+ Aqua.set_storage_engine( "CouchDB" );@V;=" example;"+Internal library loading from a stringo;: ;;0;<"r Aqua.set_storage_engine( :require => 'my_own/storage_gem', :module => 'MyOwn::StorageGem::StorageMethods' );@V;=" example;"External library loading from a gem. :module argument is the gem's module responsible for implementing the storage methodso;: ;;0;<"v Aqua.set_storage_engine( :require => '/absolute/path/to/library', :module => 'My::StorageLib::StorageMethods' );@V;=" example;">External library loading from a non-gem external library.o;: ;;0;<" public;@V;="api;0;[[@1iD;>"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;?"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;;;!T;A;;B[[" engine""CouchDB";[o;;@;6iT;7;8;9T;IC;"+Loads an internal engine from a string ;["+Loads an internal engine from a string"@api private;#o;$;%iR;&F;'iS;[;@;o;;@;[o;: ;;0;<" private;@;="api;0;[[@1iT;>"def self.load_internal_engine( str ) underscored = str.underscore require "aqua/store/#{underscored}/#{underscored}" include_engine( "Aqua::Store::#{str}::StorageMethods" ) end;?"def self.load_internal_engine( str ) underscored = str.underscore require "aqua/store/#{underscored}/#{underscored}" include_engine( "Aqua::Store::#{str}::StorageMethods" ) end;:load_internal_engine;!T;A;;B[["str0;[o;;@;6i];7;8;9T;IC;"5Loads an external engine from a hash of options. ;["6Loads an external engine from a hash of options. "Q@see Aqua#set_storage_engine for the public method that uses this internally"@api private;#o;$;%iZ;&F;'i\;[;@;o;;@;[o;: ;;0;<"4for the public method that uses this internally;@;="see;"Aqua#set_storage_engineo;: ;;0;<" private;@;="api;0;[[@1i];>"odef self.include_engine( str ) Aqua::Storage.class_eval do include str.constantize end end;?"gdef self.include_engine( str ) Aqua::Storage.class_eval do include str.constantize end end;:include_engine;!T;A;;B[["str0;[o; ;o; ;@ ;;(;0@; IC; [;@;IC;{;IC;{;T;IC;{;T;T;IC;" ;";#0;[;@;o;;@;[;[["lib/aqua/object/config.rbi;IC; [;@;: Config;!F;"IC; [o;;@;6i;7;8;9T;IC;" ;";#0;[;@ ;o;;@;[;[[@ i;>"def self.included( klass ) klass.class_eval do extend ClassMethods configure_aqua hide_attributes :_aqua_opts end end ;?"def self.included( klass ) klass.class_eval do extend ClassMethods configure_aqua hide_attributes :_aqua_opts end end;;q;!F;A;;B[[" klass0;[o; ;@; IC; [;@ ;IC;{;IC;{;T;IC;{;T;T;IC;" ;";#0;[;@ ;o;;@;[;[[@ i;IC; [;@ ;;r;!F;"IC; [o;;@ ;6i;7;8;9T;IC;" ;";#0;[;@# ;o;;@;[;[[@ i;>"`def configure_aqua(opts={}) @_aqua_opts = Mash.new( _aqua_opts ).merge!(opts) end;?"Xdef configure_aqua(opts={}) @_aqua_opts = Mash.new( _aqua_opts ).merge!(opts) end;:configure_aqua;!F;A;;B[[" opts"{};[o;;@ ;6i;7;8;9T;IC;" ;";#0;[;@2 ;o;;@;[;[[@ i;>"Jdef _aqua_opts @_aqua_opts ||= _aqua_config_defaults end ;?"?def _aqua_opts @_aqua_opts ||= _aqua_config_defaults end;:_aqua_opts;!F;A;;B[;[o;;@ ;6i;7: private;9T;IC;" ;";#0;[;@> ;o;;@;[;[[@ i;>"def _aqua_config_defaults { :database => nil, # Default is the same as the server. Everything is saved to the same db :embed => false, # options false, true, or :stub => [:attributes, :to_save, :in_the_other_object] } end;?"def _aqua_config_defaults { :database => nil, # Default is the same as the server. Everything is saved to the same db :embed => false, # options false, true, or :stub => [:attributes, :to_save, :in_the_other_object] } end;:_aqua_config_defaults;!F;A;;B[;[;@ ;-{;[;@;-{;[o; ;o; ;@ ;;(;0@; IC; [;@N ;IC;{;IC;{;T;IC;{;T;T;IC;"This module is responsible for packing objects into Storage Objects The Storage Object is expected to be a Mash-Like thing (Hash with indifferent access). It is the job of the storage engine to convert the Mash into the actual storage data. Aqua::Pack ;[ "HThis module is responsible for packing objects into Storage Objects"[The Storage Object is expected to be a Mash-Like thing (Hash with indifferent access)."ZIt is the job of the storage engine to convert the Mash into the actual storage data."Aqua::Pack ;#o;$;%i;&F;'i ;[;@N ;o;;@;[;[["lib/aqua/object/pack.rbi ;IC; [;@N ;: Pack;!T;"IC; [o;;@N ;6i ;7;8;9T;IC;" ;";#0;[;@c ;o;;@;[;[[@` i ;>">def self.included( klass ) klass.class_eval do extend ClassMethods include InstanceMethods unless instance_methods.include?( 'id=' ) || new.instance_variables.include?( '@id' ) attr_accessor :id end hide_attributes :_store, :__pack, :id, :_rev end end ;?"'def self.included( klass ) klass.class_eval do extend ClassMethods include InstanceMethods unless instance_methods.include?( 'id=' ) || new.instance_variables.include?( '@id' ) attr_accessor :id end hide_attributes :_store, :__pack, :id, :_rev end end;;q;!F;A;;B[[" klass0;[o; ;@N ; IC; [;@q ;IC;{;IC;{;T;IC;{;T;T;IC;"ClassMethods ;["ClassMethods;#o;$;%i3;&F;'i3;[;@q ;o;;@;[;[[@` i;IC; [;@q ;;r;!T;"IC; [o;;@q ;6i%;7;8;9T;IC;"ZUsed in class declaration to assign certain instance variables as not for persistance ;["ZUsed in class declaration to assign certain instance variables as not for persistance"1@param [Symbol] or [Array of Symbols] ivars "" @example"class User " include Aqua::Object"b attr_accessor :username, :email, :password, :password_confirmation, :cryped_password, :salt"A hide_instance_variables :password, :password_confirmation ") # ... lots more user code here ..."end"cIn this case it is useful for omitting sensitive information while persisting the object, but "bmaintaining the password and confirmation temporarily requires the use of instance variables.;#o;$;%i;&F;'i$;[;@ ;o;;@;[o;: ;;[" Symbol;<"[Array of Symbols] ivars;@ ;=" param;"oro;: ;;0;<"class User include Aqua::Object attr_accessor :username, :email, :password, :password_confirmation, :cryped_password, :salt hide_instance_variables :password, :password_confirmation # ... lots more user code here ... end In this case it is useful for omitting sensitive information while persisting the object, but maintaining the password and confirmation temporarily requires the use of instance variables.;@ ;=" example;";[[@` i%;>"def hide_attributes( *ivars ) ivars.each do |ivar| raise ArgumentError, '' unless ivar.class == Symbol _hidden_attributes << "@#{ivar}" end end;?"def hide_attributes( *ivars ) ivars.each do |ivar| raise ArgumentError, '' unless ivar.class == Symbol _hidden_attributes << "@#{ivar}" end end;:hide_attributes;!T;A;;B[[" *ivars0;[o;;@q ;6i/;7;8;9T;IC;"3Reader method for accessing hidden attributes. ;["4Reader method for accessing hidden attributes. "G@return [Array] containing strings representing instance variables"@api private;#o;$;%i,;&F;'i.;[;@ ;o;;@;[o;: ;;[" Array;<"7containing strings representing instance variables;@ ;=" return;0o;: ;;0;<" private;@ ;="api;0;[[@` i/;>"Edef _hidden_attributes @_hidden_attributes ||= [] end;?"=def _hidden_attributes @_hidden_attributes ||= [] end;:_hidden_attributes;!T;A;;B[;[;@q ;-{;[o; ;@N ; IC; [;@ ;IC;{;IC;{: _storeIC;{;Ko;;@ ;7;8;IC;"__pack is an Aqua::Storage object into which the object respresentation is packed _store is the current state of the storage of the object on CouchDB. It is used lazily and will be empty unless it is needed for unpacking or checking for changed data. _rev is needed for CouchDB store, since updates require the rev information. We could do without this accessor, but it would mean that an extra get request would have to be made with each PUT request so that the latest _rev could be obtained. ;[ "V__pack is an Aqua::Storage object into which the object respresentation is packed"[_store is the current state of the storage of the object on CouchDB. It is used lazily"Vand will be empty unless it is needed for unpacking or checking for changed data."Z_rev is needed for CouchDB store, since updates require the rev information. We could"[do without this accessor, but it would mean that an extra get request would have to be"Kmade with each PUT request so that the latest _rev could be obtained. ;#o;$;%ih;&F;'im;[;@ ;o;;@;[;[[@` iq;>"def _store=(value);?"-def _store=(value) @_store = value end;: _store=;!T;A;;B[;[;Mo;;@ ;7;8;IC;"__pack is an Aqua::Storage object into which the object respresentation is packed _store is the current state of the storage of the object on CouchDB. It is used lazily and will be empty unless it is needed for unpacking or checking for changed data. _rev is needed for CouchDB store, since updates require the rev information. We could do without this accessor, but it would mean that an extra get request would have to be made with each PUT request so that the latest _rev could be obtained. ;@ ;#@ ;[;@ ;o;;@;[;[[@` iq;>"def _store;?"def _store @_store end;;;!T;A;;B[;[;T: __packIC;{;Ko;;@ ;7;8;IC;"__pack is an Aqua::Storage object into which the object respresentation is packed _store is the current state of the storage of the object on CouchDB. It is used lazily and will be empty unless it is needed for unpacking or checking for changed data. _rev is needed for CouchDB store, since updates require the rev information. We could do without this accessor, but it would mean that an extra get request would have to be made with each PUT request so that the latest _rev could be obtained. ;@ ;#@ ;[;@ ;o;;@;[;[[@` iq;>"def __pack=(value);?"-def __pack=(value) @__pack = value end;: __pack=;!T;A;;B[;[;Mo;;@ ;7;8;IC;"__pack is an Aqua::Storage object into which the object respresentation is packed _store is the current state of the storage of the object on CouchDB. It is used lazily and will be empty unless it is needed for unpacking or checking for changed data. _rev is needed for CouchDB store, since updates require the rev information. We could do without this accessor, but it would mean that an extra get request would have to be made with each PUT request so that the latest _rev could be obtained. ;@ ;#@ ;[;@ ;o;;@;[;[[@` iq;>"def __pack;?"def __pack @__pack end;;;!T;A;;B[;[;T: _revIC;{;Ko;;@ ;7;8;IC;"__pack is an Aqua::Storage object into which the object respresentation is packed _store is the current state of the storage of the object on CouchDB. It is used lazily and will be empty unless it is needed for unpacking or checking for changed data. _rev is needed for CouchDB store, since updates require the rev information. We could do without this accessor, but it would mean that an extra get request would have to be made with each PUT request so that the latest _rev could be obtained. ;@ ;#@ ;[;@ ;o;;@;[;[[@` iq;>"def _rev=(value);?")def _rev=(value) @_rev = value end;: _rev=;!T;A;;B[;[;Mo;;@ ;7;8;IC;"__pack is an Aqua::Storage object into which the object respresentation is packed _store is the current state of the storage of the object on CouchDB. It is used lazily and will be empty unless it is needed for unpacking or checking for changed data. _rev is needed for CouchDB store, since updates require the rev information. We could do without this accessor, but it would mean that an extra get request would have to be made with each PUT request so that the latest _rev could be obtained. ;@ ;#@ ;[;@ ;o;;@;[;[[@` iq;>" def _rev;?"def _rev @_rev end;;;!T;A;;B[;[;T;T;IC;{;T;T;IC;"InstanceMethods ;["InstanceMethods ;#o;$;%i;&F;'i;[;@ ;o;;@;[;[[@` i5;IC; [;@ ;;t;!T;"IC; [o;;@ ;6i9;7;8;9T;IC;"TODO: option for transaction on children documents, all or nothing Saves object; returns false on failure; returns self on success. ;["GTODO: option for transaction on children documents, all or nothing"ESaves object; returns false on failure; returns self on success.;#o;$;%i6;&F;'i7;[;@ ;o;;@;[;[[@` i9;>"&def commit _commit end;?"def commit _commit end;;v;!T;A;;B[;[o;;@ ;6i>;7;8;9T;IC;"0Saves object and raises an error on failure ;["0Saves object and raises an error on failure;#o;$;%i=;&F;'i=;[;@, ;o;;@;[;[[@` i>;>"/def commit! _commit( false ) end;?"'def commit! _commit( false ) end;: commit!;!T;A;;B[;[o;;@ ;6iF;7;8;9T;IC;"Npacks an object from it's Ruby state into a Hash-like object for storage. ;[ "Opacks an object from it's Ruby state into a Hash-like object for storage. "@return [Aqua::Storage]""@api private;#o;$;%iB;&F;'iE;[;@: ;o;;@;[o;: ;;["Aqua::Storage;<";@: ;=" return;0o;: ;;0;<" private;@: ;="api;0;[[@` iF;>"def _pack class_name = self.class.to_s self.__pack = Aqua::Storage.new self.__pack.id = @id if @id self.__pack[:_rev] = _rev if _rev self.__pack[:class] = class_name _pack_properties _pack_singletons __pack end;?"def _pack class_name = self.class.to_s self.__pack = Aqua::Storage.new self.__pack.id = @id if @id self.__pack[:_rev] = _rev if _rev self.__pack[:class] = class_name _pack_properties _pack_singletons __pack end;: _pack;!T;A;;B[;[o;;@ ;6iX;7;8;9T;IC;"QDetails from configuration options for the objects class about embedability. ;[ "RDetails from configuration options for the objects class about embedability. "[@return [true, false, Hash] If true then it should be embedded in the object at hand. "` If false, then it should be saved externally. If a hash, with the key :stub and a related"V value that is an array of methods, then the object should be saved externally, "9 with a few cached methods as defined in the array.""@api private;#o;$;%iQ;&F;'iW;[;@S ;o;;@;[o;: ;;[" true" false" Hash;<"If true then it should be embedded in the object at hand. If false, then it should be saved externally. If a hash, with the key :stub and a related value that is an array of methods, then the object should be saved externally, with a few cached methods as defined in the array.;@S ;=" return;0o;: ;;0;<" private;@S ;="api;0;[[@` iX;>"@def _embed_me self.class._aqua_opts[:embed] end ;?"7def _embed_me self.class._aqua_opts[:embed] end;:_embed_me;!T;A;;B[;[o;;@ ;6i`;7;8;9T;IC;"8An array of instance variables that are not hidden. ;[ "8An array of instance variables that are not hidden."4@return [Array] of names for instance variables""@api private;#o;$;%i\;&F;'i_;[;@q ;o;;@;[o;: ;;[" Array;<"$of names for instance variables;@q ;=" return;0o;: ;;0;<" private;@q ;="api;0;[[@` i`;>"fdef _storable_attributes (instance_variables||[]) - self.class._hidden_attributes end ;?"\def _storable_attributes (instance_variables||[]) - self.class._hidden_attributes end;:_storable_attributes;!T;A;;B[;[@ @ @ @ @ @ o;;@ ;6iu;7;;9T;IC;" ;";#0;[;@ ;o;;@;[;[[@` iu;>"def _commit( mask_exception = true ) result = true begin _pack _save_to_store rescue Exception => e if mask_exception result = false else raise e end end if result self.id = __pack.id self._rev = __pack.rev _clear_accessors self else result end end ;?"Edef _commit( mask_exception = true ) result = true begin _pack _save_to_store rescue Exception => e if mask_exception result = false else raise e end end if result self.id = __pack.id self._rev = __pack.rev _clear_accessors self else result end end;: _commit;!F;A;;B[["mask_exception" true;[o;;@ ;6i;7;;9T;IC;"jObject packing methods ------------ Examines each ivar and converts it to a hash, array, string combo ;["(Object packing methods ------------"FExamines each ivar and converts it to a hash, array, string combo"@api private;#o;$;%i;&F;'i;[;@ ;o;;@;[o;: ;;0;<" private;@ ;="api;0;[[@` i;>"def _pack_properties self.__pack[:data] = _pack_ivars( self ) initializations = _pack_initializations( self ) self.__pack[:initialization] = initializations unless initializations.empty? end;?"def _pack_properties self.__pack[:data] = _pack_ivars( self ) initializations = _pack_initializations( self ) self.__pack[:initialization] = initializations unless initializations.empty? end;:_pack_properties;!T;A;;B[;[o;;@ ;6i;7;;9T;IC;" ;";#0;[;@ ;o;;@;[;[[@` i;>"def _pack_initializations( obj ) ancestors = obj.class.ancestors initializations = {} if ancestors.include?( Array ) initializations = _pack_array( obj ) elsif ancestors.include?( Hash ) initializations = _pack_hash( obj ) elsif ancestors.include?( OpenStruct ) initializations = _pack_struct( obj ) end initializations end ;?"bdef _pack_initializations( obj ) ancestors = obj.class.ancestors initializations = {} if ancestors.include?( Array ) initializations = _pack_array( obj ) elsif ancestors.include?( Hash ) initializations = _pack_hash( obj ) elsif ancestors.include?( OpenStruct ) initializations = _pack_struct( obj ) end initializations end;:_pack_initializations;!F;A;;B[["obj0;[o;;@ ;6i;7;;9T;IC;"=Examines an object for its ivars, packs each into a hash ;[">Examines an object for its ivars, packs each into a hash "@api private;#o;$;%i;&F;'i;[;@ ;o;;@;[o;: ;;0;<" private;@ ;="api;0;[[@` i;>"Tdef _pack_ivars( obj ) return_hash = {} vars = obj.aquatic? ? obj._storable_attributes : obj.instance_variables vars.each do |ivar_name| ivar = obj.instance_variable_get( ivar_name ) return_hash[ivar_name] = _pack_object( ivar ) unless ivar.nil? end return_hash end ;?""def _pack_ivars( obj ) return_hash = {} vars = obj.aquatic? ? obj._storable_attributes : obj.instance_variables vars.each do |ivar_name| ivar = obj.instance_variable_get( ivar_name ) return_hash[ivar_name] = _pack_object( ivar ) unless ivar.nil? end return_hash end;:_pack_ivars;!T;A;;B[["obj0;[o;;@ ;6i;7;;9T;IC;"Packs an object into data and meta data. Works recursively sending out to array, hash, etc. object packers, which send their values back to _pack_object ;[ "bPacks an object into data and meta data. Works recursively sending out to array, hash, etc. "Aobject packers, which send their values back to _pack_object""@param Object to pack"[@return [Mash] Indifferent hash that is the data/metadata deconstruction of an object.""@api private;#o;$;%i;&F;'i;[;@ ;o;;@;[o;: ;;0;<" to pack;@ ;=" param;" Objecto;: ;;[" Mash;<"LIndifferent hash that is the data/metadata deconstruction of an object.;@ ;=" return;0o;: ;;0;<" private;@ ;="api;0;[[@` i;>"def _pack_object( obj ) klass = obj.class if klass == String obj elsif [TrueClass, FalseClass].include?( klass ) { 'class' => klass.to_s, 'initialization' => obj.to_s } elsif [Time, Date, Fixnum, Bignum, Float ].include?( klass ) { 'class' => klass.to_s, 'initialization' => obj.to_s } elsif klass == Rational { 'class' => klass.to_s, 'initialization' => obj.to_s.match(/(\d*)\/(\d*)/).to_a.slice(1,2) } else # a more complex object, including an array or a hash like thing return_hash = {} if obj.aquatic? # TODO distinguish between internal storage, stubbing and external (obj.aquatic? && obj._embed_me == true) return_hash = obj._pack elsif !obj.aquatic? initialization = _pack_initializations( obj ) return_hash['initialization'] = initialization unless initialization.empty? data = _pack_ivars( obj ) return_hash['data'] = data unless data.empty? return_hash['class'] = klass.to_s # TODO: distinguish between internal storage, stubbing and external (obj.aquatic? && obj._embed_me == true) # elsif obj._embed_me.class == Hash # return_hash = _stub( obj ) # else # return_hash = _pack_to_external(obj) end return_hash end end ;?"def _pack_object( obj ) klass = obj.class if klass == String obj elsif [TrueClass, FalseClass].include?( klass ) { 'class' => klass.to_s, 'initialization' => obj.to_s } elsif [Time, Date, Fixnum, Bignum, Float ].include?( klass ) { 'class' => klass.to_s, 'initialization' => obj.to_s } elsif klass == Rational { 'class' => klass.to_s, 'initialization' => obj.to_s.match(/(\d*)\/(\d*)/).to_a.slice(1,2) } else # a more complex object, including an array or a hash like thing return_hash = {} if obj.aquatic? # TODO distinguish between internal storage, stubbing and external (obj.aquatic? && obj._embed_me == true) return_hash = obj._pack elsif !obj.aquatic? initialization = _pack_initializations( obj ) return_hash['initialization'] = initialization unless initialization.empty? data = _pack_ivars( obj ) return_hash['data'] = data unless data.empty? return_hash['class'] = klass.to_s # TODO: distinguish between internal storage, stubbing and external (obj.aquatic? && obj._embed_me == true) # elsif obj._embed_me.class == Hash # return_hash = _stub( obj ) # else # return_hash = _pack_to_external(obj) end return_hash end end;:_pack_object;!T;A;;B[["obj0;[o;;@ ;6i;7;;9T;IC;"@The portion of the recursive mechanism that packs up hashes ;[ "@The portion of the recursive mechanism that packs up hashes")@param [Hash] or Hash derived object"G@return [Hash] The parsed Hash representation of the argument Hash""@api private;#o;$;%i;&F;'i;[;@ ;o;;@;[o;: ;;[" Hash;<"Hash derived object;@ ;=" param;"oro;: ;;[" Hash;<"8The parsed Hash representation of the argument Hash;@ ;=" return;0o;: ;;0;<" private;@ ;="api;0;[[@` i;>":def _pack_hash( hash ) return_hash = {} hash.each do |key, value| raise ArgumentError, 'Currently Hash keys must be either strings or symbols' unless [Symbol, String].include?( key.class ) return_hash[key.to_s] = _pack_object( value ) end return_hash end;?"def _pack_hash( hash ) return_hash = {} hash.each do |key, value| raise ArgumentError, 'Currently Hash keys must be either strings or symbols' unless [Symbol, String].include?( key.class ) return_hash[key.to_s] = _pack_object( value ) end return_hash end;:_pack_hash;!T;A;;B[[" hash0;[o;;@ ;6i;7;;9T;IC;" ;";#0;[;@ ;o;;@;[;[[@` i;>"gdef _pack_struct( struct ) _pack_hash( struct.instance_variable_get("@table") ) end;?"[def _pack_struct( struct ) _pack_hash( struct.instance_variable_get("@table") ) end;:_pack_struct;!F;A;;B[[" struct0;[o;;@ ;6i;7;;9T;IC;"@The portion of the recursive mechanism that packs up arrays ;[ "@The portion of the recursive mechanism that packs up arrays"+@param [Array] or Array derived object"J@return [Array] The parsed Array representation of the argument Array""@api private;#o;$;%i;&F;'i;[;@ ;o;;@;[o;: ;;[" Array;<"Array derived object;@ ;=" param;"oro;: ;;[" Array;<":The parsed Array representation of the argument Array;@ ;=" return;0o;: ;;0;<" private;@ ;="api;0;[[@` i;>"def _pack_array( arr ) return_arr = [] arr.each do |obj| return_arr << _pack_object( obj ) end return_arr end ;?"|def _pack_array( arr ) return_arr = [] arr.each do |obj| return_arr << _pack_object( obj ) end return_arr end;:_pack_array;!T;A;;B[["arr0;[o;;@ ;6i;7;;9T;IC;" ;";#0;[;@B ;o;;@;[;[[@` i;>"def _pack_singletons # TODO: figure out 1.8 and 1.9 compatibility issues. # Also learn the library usage, without any docs :( end ;?"def _pack_singletons # TODO: figure out 1.8 and 1.9 compatibility issues. # Also learn the library usage, without any docs :( end;:_pack_singletons;!F;A;;B[;[o;;@ ;6i;7;;9T;IC;" ;";#0;[;@N ;o;;@;[;[[@` i;>"8def _save_to_store __pack.commit end;?",def _save_to_store __pack.commit end;:_save_to_store;!F;A;;B[;[o;;@ ;6i;7;;9T;IC;" ;";#0;[;@Z ;o;;@;[;[[@` i;>"Wdef _clear_accessors self.__pack = nil self._store = nil end;?"Edef _clear_accessors self.__pack = nil self._store = nil end;:_clear_accessors;!F;A;;B[;[;@ ;-{;[;@N ;-{;[o; ;o; ;@ ;;(;0@; IC; [;@j ;IC;{;IC;{;T;IC;{;T;T;IC;" ;";#0;[;@j ;o;;@;[;[["lib/aqua/object/query.rbi;IC; [;@j ;: Query;!F;"IC; [o;;@j ;6i;7;8;9T;IC;" ;";#0;[;@z ;o;;@;[;[[@w i;>"|def self.included( klass ) klass.class_eval do extend ClassMethods include InstanceMethods end end ;?"vdef self.included( klass ) klass.class_eval do extend ClassMethods include InstanceMethods end end;;q;!F;A;;B[[" klass0;[o; ;@j ; IC; [;@ ;IC;{;IC;{;T;IC;{;T;T;IC;" ;";#0;[;@ ;o;;@;[;[[@w i;IC; [;@ ;;r;!F;"IC; [;@ ;-{;[o; ;@j ; IC; [;@ ;IC;{;IC;{;T;IC;{;T;T;IC;" ;";#0;[;@ ;o;;@;[;[[@w i;IC; [;@ ;;t;!F;"IC; [;@ ;-{;[;@j ;-{;[o; ;o; ;@ ;;(;0@; IC; [;@ ;IC;{;IC;{;T;IC;{;T;T;IC;" ;";#0;[;@ ;o;;@;[;[["lib/aqua/object/tank.rbi ;IC; [;@ ;: Tank;!F;"IC; [o;;@ ;6i ;7;8;9T;IC;" ;";#0;[;@ ;o;;@;[;[[@ i ;>"def self.included( klass ) klass.class_eval do include Aqua::Pack include Aqua::Unpack include Aqua::Config include Aqua::Query end end;?"def self.included( klass ) klass.class_eval do include Aqua::Pack include Aqua::Unpack include Aqua::Config include Aqua::Query end end;;q;!F;A;;B[[" klass0;[;@ ;-{;[@ ;@;-{;[o; ;@ ; IC; [;@ ;IC;{;IC;{;T;IC;{;T;T;IC;" ;";#0;[;@ ;o;;@;[;[["?lib/aqua/store/couch_db/http_client/adapter/rest_client.rbi;IC; [;@ ;:RestClientAdapter;!F;"IC; [ o;;@ ;6i ;7;8;9T;IC;" ;";#0;[;@ ;o;;@;[;[[@ i ;>"def self.convert_exception(&blk) begin yield rescue Exception => e ending = e.class.to_s.match(/[a-z0-9_]*\z/i) if e.message.match(/409\z/) raise Aqua::Store::CouchDB::Conflict, e.message else begin error = "Aqua::Store::CouchDB::#{ending}".constantize rescue raise e end raise error, e.message end end end ;?"def self.convert_exception(&blk) begin yield rescue Exception => e ending = e.class.to_s.match(/[a-z0-9_]*\z/i) if e.message.match(/409\z/) raise Aqua::Store::CouchDB::Conflict, e.message else begin error = "Aqua::Store::CouchDB::#{ending}".constantize rescue raise e end raise error, e.message end end end;:convert_exception;!F;A;;B[[" &blk0;[o;;@ ;6i;7;8;9T;IC;" ;";#0;[;@ ;o;;@;[;[[@ i;>"qdef self.get(uri, headers={}) convert_exception do RestClient.get(uri, headers) end end;?"idef self.get(uri, headers={}) convert_exception do RestClient.get(uri, headers) end end;:get;!F;A;;B[["uri0[" headers"{};[o;;@ ;6i!;7;8;9T;IC;" ;";#0;[;@ ;o;;@;[;[[@ i!;>"|def self.post(uri, hash, headers={}) convert_exception do RestClient.post(uri, hash, headers) end end;?"tdef self.post(uri, hash, headers={}) convert_exception do RestClient.post(uri, hash, headers) end end;: post;!F;A;;B[["uri0[" hash0[" headers"{};[o;;@ ;6i';7;8;9T;IC;" ;";#0;[;@ ;o;;@;[;[[@ i';>"zdef self.put(uri, hash, headers={}) convert_exception do RestClient.put(uri, hash, headers) end end;?"rdef self.put(uri, hash, headers={}) convert_exception do RestClient.put(uri, hash, headers) end end;:put;!F;A;;B[["uri0[" hash0[" headers"{};[o;;@ ;6i-;7;8;9T;IC;" ;";#0;[;@ ;o;;@;[;[[@ i-;>"udef self.delete(uri, headers={}) convert_exception do RestClient.delete(uri, headers) end end;?"mdef self.delete(uri, headers={}) convert_exception do RestClient.delete(uri, headers) end end;;X;!F;A;;B[["uri0[" headers"{};[o;;@ ;6i3;7;8;9T;IC;" ;";#0;[;@1 ;o;;@;[;[[@ i3;>" def self.copy(uri, headers) convert_exception do RestClient::Request.execute( :method => :copy, :url => uri, :headers => headers) end end;?"def self.copy(uri, headers) convert_exception do RestClient::Request.execute( :method => :copy, :url => uri, :headers => headers) end end;: copy;!F;A;;B[["uri0[" headers0;[;@ ;-{;[o; ;@ ; IC; [;@C ;IC;{;IC;{;T;IC;{;T;T;IC;"HTTP Adapters should implement the following to be used with the RestAPI module def self.get(uri, headers=nil) end def self.post(uri, hash, headers=nil) end def self.put(uri, hash, headers=nil) end def self.delete(uri, headers=nil) end def self.copy(uri, headers) end ;["THTTP Adapters should implement the following to be used with the RestAPI module""#def self.get(uri, headers=nil)"end""*def self.post(uri, hash, headers=nil)"end"")def self.put(uri, hash, headers=nil)"end""&def self.delete(uri, headers=nil)"end"" def self.copy(uri, headers)"end ;#o;$;%i;&F;'i;[;@C ;o;;@;[;[["4lib/aqua/store/couch_db/http_client/rest_api.rbi;IC; [;@C ;: RestAPI;!T;"IC; [ o;;@C ;6i;7;8;9T;IC;" ;";#0;[;@c ;o;;@;[;[[@` i;>":def self.adapter=( klass ) @adapter = klass end;?"6def self.adapter=( klass ) @adapter = klass end;: adapter=;!F;A;;B[[" klass0;[o;;@C ;6i;7;8;9T;IC;" ;";#0;[;@q ;o;;@;[;[[@` i;>"-def self.adapter @adapter end ;?"$def self.adapter @adapter end;: adapter;!F;A;;B[;[o;;@C ;6i ;7;8;9T;IC;" ;";#0;[;@} ;o;;@;[;[[@` i ;>"def put(uri, doc = nil) hash = doc.to_json if doc response = RestAPI.adapter.put( uri, hash ) JSON.parse( response ) end;?"~def put(uri, doc = nil) hash = doc.to_json if doc response = RestAPI.adapter.put( uri, hash ) JSON.parse( response ) end;;;!F;A;;B[["uri0["doc"nil;[o;;@C ;6i&;7;8;9T;IC;" ;";#0;[;@ ;o;;@;[;[[@` i&;>"rdef get(uri) response = RestAPI.adapter.get(uri) JSON.parse( response , :max_nesting => false) end;?"ldef get(uri) response = RestAPI.adapter.get(uri) JSON.parse( response , :max_nesting => false) end;;;!F;A;;B[["uri0;[o;;@C ;6i+;7;8;9T;IC;" ;";#0;[;@ ;o;;@;[;[[@` i+;>"def post(uri, doc = nil) hash = doc.to_json if doc response = RestAPI.adapter.post(uri, hash) JSON.parse( response ) end;?"def post(uri, doc = nil) hash = doc.to_json if doc response = RestAPI.adapter.post(uri, hash) JSON.parse( response ) end;;;!F;A;;B[["uri0["doc"nil;[o;;@C ;6i1;7;8;9T;IC;" ;";#0;[;@ ;o;;@;[;[[@` i1;>"adef delete(uri) response = RestAPI.adapter.delete(uri) JSON.parse( response ) end;?"[def delete(uri) response = RestAPI.adapter.delete(uri) JSON.parse( response ) end;;X;!F;A;;B[["uri0;[o;;@C ;6i6;7;8;9T;IC;" ;";#0;[;@ ;o;;@;[;[[@` i6;>"def copy(uri, destination) response = RestAPI.adapter.copy(uri, {'Destination' => destination}) JSON.parse( response ) end;?"def copy(uri, destination) response = RestAPI.adapter.copy(uri, {'Destination' => destination}) JSON.parse( response ) end;;;!F;A;;B[["uri0["destination0;[;@C ;-{;[;@ ;-{;[;;(;0@; IC; [;@ ;IC;{;IC;{;T;IC;{;T;T;IC;" ;";#0;[;@ ;o;;@;[;[["lib/aqua/object/unpack.rbi;IC; [;@ ;: Unpack;!F;"IC; [o;;@ ;6i;7;8;9T;IC;" ;";#0;[;@ ;o;;@;[;[[@ i;>"|def self.included( klass ) klass.class_eval do extend ClassMethods include InstanceMethods end end ;?"vdef self.included( klass ) klass.class_eval do extend ClassMethods include InstanceMethods end end;;q;!F;A;;B[[" klass0;[@o; ;@ ; IC; [;@ ;IC;{;IC;{;T;IC;{;T;T;IC;" ;";#0;[;@ ;o;;@;[;[[@ i;IC; [;@ ;;t;!F;"IC; [o;;@ ;6i;7;8;9T;IC;" ;";#0;[;@ ;o;;@;[;[[@ i;>"def reload( mask_exceptions = true ) if id.nil? if mask_exceptions false else raise ObjectNotFound, "#{self.class} instance must have an id to be reloaded" end else begin _reload rescue Exception => e if mask_exceptions false else raise e end end end end;?"cdef reload( mask_exceptions = true ) if id.nil? if mask_exceptions false else raise ObjectNotFound, "#{self.class} instance must have an id to be reloaded" end else begin _reload rescue Exception => e if mask_exceptions false else raise e end end end end;: reload;!F;A;;B[["mask_exceptions" true;[o;;@ ;6i.;7;8;9T;IC;" ;";#0;[;@ ;o;;@;[;[[@ i.;>"0def reload! reload( false ) end ;?"&def reload! reload( false ) end;: reload!;!F;A;;B[;[o;;@ ;6i3;7;;9T;IC;" ;";#0;[;@ ;o;;@;[;[[@ i3;>"_def _reload _get_store _unpack _clear_store self end;?"Adef _reload _get_store _unpack _clear_store self end;: _reload;!F;A;;B[;[o;;@ ;6i:;7;;9T;IC;" ;";#0;[;@ ;o;;@;[;[[@ i:;>"def _get_store # this is kind of klunky, should refactor self._store = Aqua::Storage.new(:id => self.id).retrieve end;?"def _get_store # this is kind of klunky, should refactor self._store = Aqua::Storage.new(:id => self.id).retrieve end;:_get_store;!F;A;;B[;[o;;@ ;6i?;7;;9T;IC;" ;";#0;[;@, ;o;;@;[;[[@ i?;>"def _unpack if init = _unpack_initialization( _store ) replace( init ) end if ivars = _store[:data] _unpack_ivars( self, ivars ) end end ;?"def _unpack if init = _unpack_initialization( _store ) replace( init ) end if ivars = _store[:data] _unpack_ivars( self, ivars ) end end;: _unpack;!F;A;;B[;[o;;@ ;6iH;7;;9T;IC;" ;";#0;[;@8 ;o;;@;[;[[@ iH;>"7def _clear_store @_store = nil end ;?")def _clear_store @_store = nil end;:_clear_store;!F;A;;B[;[o;;@ ;6iL;7;;9T;IC;" ;";#0;[;@D ;o;;@;[;[[@ iL;>"?def _unpack_ivars( obj, data ) data.each do |ivar_name, data_package| unpacked = if data_package.class == String data_package else _unpack_object( data_package ) end obj.instance_variable_set( ivar_name, unpacked ) end end ;?"def _unpack_ivars( obj, data ) data.each do |ivar_name, data_package| unpacked = if data_package.class == String data_package else _unpack_object( data_package ) end obj.instance_variable_set( ivar_name, unpacked ) end end;:_unpack_ivars;!F;A;;B[["obj0[" data0;[o;;@ ;6iW;7;;9T;IC;" ;";#0;[;@T ;o;;@;[;[[@ iW;>"@def _unpack_initialization( obj ) if init = obj[:initialization] init_class = init.class if init_class == String init elsif init.class == Array _unpack_array( init ) else _unpack_hash( init ) end end end ;?"def _unpack_initialization( obj ) if init = obj[:initialization] init_class = init.class if init_class == String init elsif init.class == Array _unpack_array( init ) else _unpack_hash( init ) end end end;:_unpack_initialization;!F;A;;B[["obj0;[o;;@ ;6id;7;;9T;IC;" ;";#0;[;@b ;o;;@;[;[[@ id;>"def _unpack_array( obj ) arr = [] obj.each do |value| value = _unpack_object( value ) unless value.class == String arr << value end arr end;?"def _unpack_array( obj ) arr = [] obj.each do |value| value = _unpack_object( value ) unless value.class == String arr << value end arr end;:_unpack_array;!F;A;;B[["obj0;[o;;@ ;6im;7;;9T;IC;" ;";#0;[;@p ;o;;@;[;[[@ im;>"def _unpack_hash( obj ) hash = {} obj.each do |key, value| value = _unpack_object( value ) unless value.class == String hash[key] = value end hash end ;?"def _unpack_hash( obj ) hash = {} obj.each do |key, value| value = _unpack_object( value ) unless value.class == String hash[key] = value end hash end;:_unpack_hash;!F;A;;B[["obj0;[o;;@ ;6iv;7;;9T;IC;" ;";#0;[;@~ ;o;;@;[;[[@ iv;>"V def _unpack_object( store_pack ) # store_pack will be: an array, a string, a hash # a hash that has the class key is an object representation # an array will either have strings or object representations # a hash that doesn't have a class key is a hash and may have object representations package_class = store_pack.class if package_class == String store_pack elsif package_class == Array _unpack_array( store_pack ) else # package_class == Hash -or- Mash if obj_class_string = store_pack['class'] # Constantize the objects class obj_class = obj_class_string.constantize rescue nil # build from initialization init = _unpack_initialization( store_pack ) return_object = if init init_class = init.class if init_class == Array if obj_class == Rational Rational( init[0].to_i, init[1].to_i ) elsif obj_class && obj_class != Array obj_class.new.replace( init ) else # should log an error internally init end elsif init_class.ancestors.include?( Hash ) if obj_class == OpenStruct obj_class.new( init ) elsif obj_class obj_class.new.replace( init ) else # should log an error internally init end else # is a string if obj_class == Date || obj_class == Time obj_class.parse( init ) elsif [Fixnum, Bignum].include?( obj_class ) init.to_i elsif obj_class == Float init.to_f elsif obj_class == TrueClass true elsif obj_class == FalseClass false else nil end end end # Build uninitialized object if return_object.nil? if obj_class return_object = obj_class.new else # should log an error internally return_object = OpenStruct.new end end # add the ivars if ivars = store_pack['data'] ivars.delete('@table') if obj_class.ancestors.include?( OpenStruct ) _unpack_ivars( return_object, ivars ) end return_object else # not a packaged object, just a hash, so unpack _unpack_hash( hash ) end end end ;?" def _unpack_object( store_pack ) # store_pack will be: an array, a string, a hash # a hash that has the class key is an object representation # an array will either have strings or object representations # a hash that doesn't have a class key is a hash and may have object representations package_class = store_pack.class if package_class == String store_pack elsif package_class == Array _unpack_array( store_pack ) else # package_class == Hash -or- Mash if obj_class_string = store_pack['class'] # Constantize the objects class obj_class = obj_class_string.constantize rescue nil # build from initialization init = _unpack_initialization( store_pack ) return_object = if init init_class = init.class if init_class == Array if obj_class == Rational Rational( init[0].to_i, init[1].to_i ) elsif obj_class && obj_class != Array obj_class.new.replace( init ) else # should log an error internally init end elsif init_class.ancestors.include?( Hash ) if obj_class == OpenStruct obj_class.new( init ) elsif obj_class obj_class.new.replace( init ) else # should log an error internally init end else # is a string if obj_class == Date || obj_class == Time obj_class.parse( init ) elsif [Fixnum, Bignum].include?( obj_class ) init.to_i elsif obj_class == Float init.to_f elsif obj_class == TrueClass true elsif obj_class == FalseClass false else nil end end end # Build uninitialized object if return_object.nil? if obj_class return_object = obj_class.new else # should log an error internally return_object = OpenStruct.new end end # add the ivars if ivars = store_pack['data'] ivars.delete('@table') if obj_class.ancestors.include?( OpenStruct ) _unpack_ivars( return_object, ivars ) end return_object else # not a packaged object, just a hash, so unpack _unpack_hash( hash ) end end end;:_unpack_object;!F;A;;B[["store_pack0;[;@ ;-{;[;@ ;-{;[; IC; [;@;IC;{;IC;{;T;IC;{;T;T;IC;" ;";#0;[;@;o;;@;[;[[@ i;IC; [;@;;r;!F;"IC; [@;@;-{;[;6i;7;8;9T;IC;"ISearches the store for a document. Initializes a New Object with it. ;["JSearches the store for a document. Initializes a New Object with it. ;#o;$;%i;&F;'i;[;@;o;;@;[;[[@ i;>"mdef load( id ) instance = new instance.id = id instance.reload instance end;?"Ydef load( id ) instance = new instance.id = id instance.reload instance end;: load;!T;A;;B[["id0;[:*Aqua::Pack::InstanceMethods#_embed_me@S :Aqua::Tank@ :@Aqua::Store::CouchDB::StorageMethods::InstanceMethods#save!@:2Aqua::Store::CouchDB::Server#uuid_batch_count@g:/Aqua::Unpack::InstanceMethods#_unpack_hash@p :+Aqua::Pack::InstanceMethods#_pack_hash@ :,Aqua::Store::CouchDB::Server#uuid_count@L:RestClientAdapter.post@ :>Aqua::Store::CouchDB::StorageMethods::InstanceMethods#rev@`:&Aqua::Pack::InstanceMethods#_rev=@ :!Aqua::Storage#method_missing@0:Aqua::Store@4:,Aqua::Store::CouchDB::Server#initialize@:.Aqua::Store::CouchDB::Database#namespaced@F:5Aqua::Config::ClassMethods#_aqua_config_defaults@> :?Aqua::Store::CouchDB::StorageMethods::InstanceMethods#new?@:RestClientAdapter.copy@1 :*Aqua::Unpack::InstanceMethods#_reload@ :'Aqua::Pack::InstanceMethods#_store@ :+Aqua::Store::CouchDB::Database.create!@:1Aqua::Pack::InstanceMethods#_pack_singletons@B :BAqua::Store::CouchDB::StorageMethods::InstanceMethods#exists?@:)Aqua::Store::CouchDB::StorageMethods@}:RestAPI.adapter@q :BAqua::Store::CouchDB::StorageMethods::InstanceMethods#delete!@[:-Aqua::Store::CouchDB::Server#delete_all!@:*Aqua::Store::CouchDB::Database#delete@:0Aqua::Pack::ClassMethods#_hidden_attributes@ :RestAPI#post@ :(Aqua::Store::CouchDB::RequestFailed@k:7Aqua::Store::CouchDB::StorageMethods::ClassMethods@:/Aqua::Unpack::InstanceMethods#_clear_store@8 :1Aqua::Pack::InstanceMethods#_pack_properties@ :!Aqua::Store::CouchDB.servers@:Aqua::Query::ClassMethods@ :(Aqua::Store::CouchDB::Database#name@:3Aqua::Store::CouchDB::Server#uuid_batch_count=@W:HAqua::Store::CouchDB::StorageMethods::InstanceMethods#escape_for_id@:Aqua.include_engine@:+Aqua::Store::CouchDB::Server#database!@ :-Aqua::Store::CouchDB::Database#bulk_save@6:?Aqua::Store::CouchDB::StorageMethods::InstanceMethods#rev=@z:DAqua::Store::CouchDB::StorageMethods::InstanceMethods#revisions@:Aqua::Unpack.included@ :&Aqua::Pack::InstanceMethods#_pack@: :Aqua::Query@j :?Aqua::Store::CouchDB::StorageMethods::InstanceMethods#save@O:.Aqua::Store::CouchDB::Database#bulk_cache@:#Aqua::Store::CouchDB::Conflict@:0Aqua::Unpack::InstanceMethods#_unpack_array@b :-Aqua::Pack::InstanceMethods#_pack_object@ :&Aqua::Store::CouchDB.paramify_url@5:MAqua::Store::CouchDB::StorageMethods::InstanceMethods#determine_database@ :*Aqua::Store::CouchDB::Server#restart!@>:(RestClientAdapter.convert_exception@ :"Aqua::Unpack::InstanceMethods@ :(Aqua::Pack::InstanceMethods#_store=@ :'Aqua::Store::CouchDB::Server#uuids@:5Aqua::Store::CouchDB::Database#initialize_server@:*Aqua::Config::ClassMethods#_aqua_opts@2 :IAqua::Store::CouchDB::StorageMethods::InstanceMethods#update_version@:RestClientAdapter.put@ :RestAPI.adapter=@c :*Aqua::Unpack::InstanceMethods#reload!@ :CAqua::Store::CouchDB::StorageMethods::InstanceMethods#save_now@:*Aqua::Store::CouchDB::Database.create@j:,Aqua::Pack::InstanceMethods#_pack_array@ :Aqua::Pack.included@c ; @ :,Aqua::Store::CouchDB::Server#load_uuids@k:'Aqua::Pack::InstanceMethods#__pack@ :CAqua::Store::CouchDB::StorageMethods::InstanceMethods#retrieve@:+Aqua::Store::CouchDB::Server#databases@:+Aqua::Store::CouchDB::Database#exists?@:Aqua.set_storage_engine@V:-Aqua::Pack::ClassMethods#hide_attributes@ :2Aqua::Store::CouchDB::StorageMethods.included@:RestAPI#put@} :*Aqua::Unpack::InstanceMethods#_unpack@, :(Aqua::Pack::InstanceMethods#_commit@ :+Aqua::Store::CouchDB::Database#delete!@:*Aqua::Store::CouchDB.set_http_adapter@:1Aqua::Pack::InstanceMethods#_clear_accessors@Z : Aqua::Pack::InstanceMethods@ :/Aqua::Store::CouchDB::Database#bulk_cache=@:>Aqua::Store::CouchDB::StorageMethods::ClassMethods#create@:RestAPI#delete@ :#Aqua::Store::CouchDB::Database@:HAqua::Store::CouchDB::StorageMethods::InstanceMethods#escape_doc_id@:Aqua.load_internal_engine@:EAqua::Store::CouchDB::StorageMethods::InstanceMethods#delete_now@:*Aqua::Store::CouchDB::Server#database@:5Aqua::Store::CouchDB::Database#add_to_bulk_cache@&:!Aqua::Query::InstanceMethods@ :(Aqua::Pack::InstanceMethods#commit!@, :!Aqua::Store::CouchDB::Server@E;@C :'Aqua::Store::CouchDB::Database#uri@:0Aqua::Store::CouchDB::ServerBrokeConnection@:(Aqua::Store::CouchDB::Server#uuids=@t:Aqua::Pack@N ::Aqua::Store::CouchDB::StorageMethods::InstanceMethods@:9Aqua::Unpack::InstanceMethods#_unpack_initialization@T :,Aqua::Pack::InstanceMethods#_pack_ivars@ :Aqua::Config.included@ :CAqua::Store::CouchDB::StorageMethods::InstanceMethods#database@:&Aqua::Store::CouchDB::Server#info@0:'Aqua::Store::CouchDB.clear_servers@!:Aqua::Unpack::ClassMethods@:AAqua::Store::CouchDB::StorageMethods::InstanceMethods#commit@u:%Aqua::Store::CouchDB::Server#uri@:.Aqua::Store::CouchDB::Database#initialize@:.Aqua::Config::ClassMethods#configure_aqua@# :RestClientAdapter.get@ : Aqua::Store::CouchDB.escape@^:=Aqua::Store::CouchDB::StorageMethods::InstanceMethods#id@$:)Aqua::Unpack::InstanceMethods#reload@ :(Aqua::Pack::InstanceMethods#__pack=@ :5Aqua::Pack::InstanceMethods#_storable_attributes@q :EAqua::Store::CouchDB::StorageMethods::InstanceMethods#save_logic@:+Aqua::Store::CouchDB::Server#namespace@J:Aqua::Unpack@ :1Aqua::Unpack::InstanceMethods#_unpack_object@~ :-Aqua::Pack::InstanceMethods#_pack_struct@ :+Aqua::Store::CouchDB::Server#next_uuid@Z:RestClientAdapter.delete@ :Aqua::ObjectNotFound@E:Aqua::Store::CouchDB@G:>Aqua::Store::CouchDB::StorageMethods::InstanceMethods#uri@:0Aqua::Store::CouchDB::Server#database_names@:Aqua::Pack::ClassMethods@q ;@ :HAqua::Store::CouchDB::StorageMethods::InstanceMethods#new_document?@:-Aqua::Unpack::InstanceMethods#_get_store@ :%Aqua::Pack::InstanceMethods#_rev@ :AAqua::Store::CouchDB::StorageMethods::InstanceMethods#delete@5:(Aqua::Store::CouchDB::Database#info@:&Aqua::Store::CouchDB.http_adapter@:/Aqua::Pack::InstanceMethods#_save_to_store@N :(Aqua::Store::CouchDB.method_missing@:DAqua::Store::CouchDB::StorageMethods::InstanceMethods#ensure_id@:RestAPI#get@ :,Aqua::Store::CouchDB::Server#delete_all@:-Aqua::Store::CouchDB::Database#documents@:DAqua::Store::CouchDB::StorageMethods::InstanceMethods#database=@:+Aqua::Store::CouchDB::ResourceNotFound@Z:GAqua::Store::CouchDB::StorageMethods::InstanceMethods#delete_logic@:Aqua::Query.included@z :'Aqua::Pack::InstanceMethods#commit@ :)Aqua::Store::CouchDB::RequestTimeout@|:&Aqua::Store::CouchDB::Server#uri=@:Aqua::Config@;(@:?Aqua::Store::CouchDB::StorageMethods::ClassMethods#create!@:RestAPI#copy@ :*Aqua::Store::CouchDB::Database#server@:0Aqua::Unpack::InstanceMethods#_unpack_ivars@D :6Aqua::Pack::InstanceMethods#_pack_initializations@ :>Aqua::Store::CouchDB::StorageMethods::InstanceMethods#id=@A: Aqua::Store::CouchDB.server@:Aqua::Tank.included@ :EAqua::Store::CouchDB::StorageMethods::InstanceMethods#initialize@,:,Aqua::Store::CouchDB::Server#namespace=@:Aqua::Storage@ :Aqua::Config::ClassMethods@ ;T{ " IOError;"ArgumentError;" Mash;" Object;