Class: ShyCouch::Data::ViewResultHandler
- Inherits:
-
Object
- Object
- ShyCouch::Data::ViewResultHandler
- Defined in:
- lib/ShyCouch/data.rb
Class Method Summary collapse
Class Method Details
.includes_docs(rows) ⇒ Object
331 332 333 |
# File 'lib/ShyCouch/data.rb', line 331 def self.includes_docs rows return rows[0].has_key? "doc" if rows.length > 0 end |
.init(res) ⇒ Object
320 321 322 323 324 325 326 327 328 329 330 |
# File 'lib/ShyCouch/data.rb', line 320 def self.init res if self.includes_docs res["rows"] collection = ShyCouch::Data::CouchDocumentCollection.new res["rows"].each do |row| collection << ShyCouch::Data::CouchDocument.new(:data => row["doc"]) end return collection else return ViewResult.new res end end |