lib/ruote/couch/storage.rb in ruote-couch-2.1.5 vs lib/ruote/couch/storage.rb in ruote-couch-2.1.7
- old
+ new
@@ -29,16 +29,27 @@
module Ruote
module Couch
+ #
+ # A CouchDB storage mechanism for ruote.
+ #
+ # The storage merely 'routes' work to Ruote::Couch::Database instances,
+ # one per document 'type' (expressions, msgs, schedules, variables, ...)
+ #
class CouchStorage
include Ruote::StorageBase
attr_reader :couch
+ # Hooks the storage to a CouchDB instance.
+ #
+ # The main option is 'prefix', which indicate which prefix should be
+ # added to all the database names used by this storage.
+ #
def initialize (host, port, options={})
@host = host
@port = port
@@ -141,9 +152,14 @@
def by_field (type, field, value=nil)
raise NotImplementedError if type != 'workitems'
@dbs['workitems'].by_field(field, value)
+ end
+
+ def query_workitems (criteria)
+
+ @dbs['workitems'].query_workitems(criteria)
end
protected
def put_configuration