Sha256: 81466a4eade19b475a413e7c9c72d489904bb69bcfbba82bec616a3a491c34db
Contents?: true
Size: 1.89 KB
Versions: 9
Compression:
Stored size: 1.89 KB
Contents
module Document # Store wrapper methods for document def get_data(doctype,type=Hash) Store.get_data(docname(doctype), type) end def get_object(doctype, key) Store.get_object(docname(doctype), key) end def get_list(doctype) Store.get_list(docname(doctype)) end def get_value(doctype) Store.get_value(docname(doctype)) end def put_object(doctype, key, data={}) Store.put_object(docname(doctype), key, data) end def put_data(doctype,data,append=false) Store.put_data(docname(doctype),data,append) end def put_list(doctype,data,append=false) Store.put_list(docname(doctype),data,append) end def update_objects(doctype,updates) Store.update_objects(docname(doctype),updates) end def remove_objects(doctype,deletes) Store.delete_objects(docname(doctype),deletes) end def put_value(doctype,data) Store.put_value(docname(doctype),data) end def delete_data(doctype,data) Store.delete_data(docname(doctype),data) end def flash_data(doctype) Store.flash_data(docname(doctype)) end def flash_source_data(doctype, from_source) self.source_name=from_source docnamestr = docname('') + doctype Store.flash_data(docnamestr) end def rename(srcdoctype,dstdoctype) Store.rename(docname(srcdoctype),docname(dstdoctype)) end def get_zdata(doctype) Store.get_zdata(docname(doctype)) end def flush_zdata(doctype) Store.flush_zdata(docname(doctype)) end def put_zdata(doctype,assoc_key, data={},append=false) Store.put_zdata(docname(doctype),assoc_key, data,append) end # Generate the fully-qualified docname def docname(doctype) "#{self.class.class_prefix(self.class)}:#{self.app_id}:#{self.doc_suffix(doctype)}" end # Update count for a given document def update_count(doctype,count) Store.update_count(docname(doctype), count) end end
Version data entries
9 entries across 9 versions & 1 rubygems