Class: ShyCouch::Data::ViewResult
- Inherits:
-
Hash
- Object
- Hash
- ShyCouch::Data::ViewResult
- Defined in:
- lib/ShyCouch/data.rb
Defined Under Namespace
Classes: ViewResultRow
Instance Attribute Summary collapse
-
#offset ⇒ Object
This is the result of a view query If the view was called with ?include_docs=true, initializing this object returns a DocumentCollection instead.
-
#total_rows ⇒ Object
This is the result of a view query If the view was called with ?include_docs=true, initializing this object returns a DocumentCollection instead.
Instance Method Summary collapse
-
#initialize(res) ⇒ ViewResult
constructor
A new instance of ViewResult.
Constructor Details
#initialize(res) ⇒ ViewResult
Returns a new instance of ViewResult.
341 342 343 344 345 346 347 348 |
# File 'lib/ShyCouch/data.rb', line 341 def initialize res @total_rows = res["total_rows"] @offset = res["offset"] res["rows"].each do |row| merge! row["key"] => ViewResultRow.new(row["value"], row["key"]) end end |
Instance Attribute Details
#offset ⇒ Object
This is the result of a view query If the view was called with ?include_docs=true, initializing this object returns a DocumentCollection instead
340 341 342 |
# File 'lib/ShyCouch/data.rb', line 340 def offset @offset end |
#total_rows ⇒ Object
This is the result of a view query If the view was called with ?include_docs=true, initializing this object returns a DocumentCollection instead
340 341 342 |
# File 'lib/ShyCouch/data.rb', line 340 def total_rows @total_rows end |