Class: Ruote::Couch::WfidIndexedDatabase
- Defined in:
- lib/ruote/couch/database.rb
Overview
A Couch database with a by_wfid view.
Direct Known Subclasses
Instance Attribute Summary
Attributes inherited from Database
Class Method Summary collapse
-
.design_doc ⇒ Object
Returns the design document that goes with this class of database.
Instance Method Summary collapse
-
#by_wfid(wfid) ⇒ Object
Used by WorkitemDatabase#query.
-
#get_many(key, opts) ⇒ Object
The get_many used by errors, expressions and schedules.
Methods inherited from Database
#delete, #dump, #get, #ids, #initialize, #purge!, #put, #shutdown
Constructor Details
This class inherits a constructor from Ruote::Couch::Database
Class Method Details
.design_doc ⇒ Object
Returns the design document that goes with this class of database
190 191 192 193 |
# File 'lib/ruote/couch/database.rb', line 190 def self.design_doc self.allocate.send(:design_doc) end |
Instance Method Details
#by_wfid(wfid) ⇒ Object
Used by WorkitemDatabase#query
183 184 185 186 |
# File 'lib/ruote/couch/database.rb', line 183 def by_wfid (wfid) get_many(wfid, {}) end |
#get_many(key, opts) ⇒ Object
The get_many used by errors, expressions and schedules.
172 173 174 175 176 177 178 179 |
# File 'lib/ruote/couch/database.rb', line 172 def get_many (key, opts) return super(key, opts) unless key.is_a?(String) # key is a wfid @couch.query_for_docs('ruote:by_wfid', :key => key) end |